mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
Add button for camera to quickly open relevant drawing
This commit is contained in:
@@ -2037,11 +2037,12 @@ class CreateView(bpy.types.Operator):
|
|||||||
class OpenView(bpy.types.Operator):
|
class OpenView(bpy.types.Operator):
|
||||||
bl_idname = 'bim.open_view'
|
bl_idname = 'bim.open_view'
|
||||||
bl_label = 'Open View'
|
bl_label = 'Open View'
|
||||||
|
view: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
webbrowser.open('file://' + os.path.join(
|
webbrowser.open('file://' + os.path.join(
|
||||||
bpy.context.scene.BIMProperties.data_dir, 'diagrams',
|
bpy.context.scene.BIMProperties.data_dir, 'diagrams',
|
||||||
bpy.context.scene.DocProperties.available_views + '.svg'))
|
self.view + '.svg'))
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
@@ -2167,6 +2168,7 @@ class CutSection(bpy.types.Operator):
|
|||||||
svg_writer.scale = float(numerator) / float(denominator)
|
svg_writer.scale = float(numerator) / float(denominator)
|
||||||
ifc_cutter.cut()
|
ifc_cutter.cut()
|
||||||
svg_writer.write()
|
svg_writer.write()
|
||||||
|
bpy.ops.bim.open_view(view=self.diagram_name)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
def is_landscape(self):
|
def is_landscape(self):
|
||||||
|
|||||||
@@ -742,7 +742,8 @@ class BIM_PT_documentation(Panel):
|
|||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(props, 'available_views', text='Available Drawings')
|
row.prop(props, 'available_views', text='Available Drawings')
|
||||||
row.operator('bim.open_view', icon='URL', text='')
|
op = row.operator('bim.open_view', icon='URL', text='')
|
||||||
|
op.view = bpy.context.scene.DocProperties.available_views
|
||||||
row.operator('bim.activate_view', icon='SCENE', text='')
|
row.operator('bim.activate_view', icon='SCENE', text='')
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
@@ -861,9 +862,13 @@ class BIM_PT_camera(Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(props, 'cut_objects_custom')
|
row.prop(props, 'cut_objects_custom')
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(props, 'diagram_scale')
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(props, 'diagram_scale', text='')
|
|
||||||
row.operator('bim.cut_section')
|
row.operator('bim.cut_section')
|
||||||
|
op = row.operator('bim.open_view', icon='URL', text='')
|
||||||
|
op.view = context.active_object.name.split('/')[1]
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_text(Panel):
|
class BIM_PT_text(Panel):
|
||||||
|
|||||||
Reference in New Issue
Block a user