mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Switch between drawings with one click, with access from the 3D view
This commit is contained in:
@@ -212,6 +212,10 @@ def refreshBoundaryConditionAttributes(self, context):
|
||||
new_attribute.name = attribute['name']
|
||||
|
||||
|
||||
def refreshActiveDrawingIndex(self, context):
|
||||
bpy.ops.bim.activate_view(drawing_index=context.scene.DocProperties.active_drawing_index)
|
||||
|
||||
|
||||
def getIfcProducts(self, context):
|
||||
global products_enum
|
||||
if len(products_enum) < 1:
|
||||
@@ -536,7 +540,7 @@ class DocProperties(PropertyGroup):
|
||||
], name='Should Render', default='DEFAULT')
|
||||
should_extract: BoolProperty(name="Should Extract", default=True)
|
||||
drawings: CollectionProperty(name='Drawings', type=Drawing)
|
||||
active_drawing_index: IntProperty(name='Active Drawing Index')
|
||||
active_drawing_index: IntProperty(name='Active Drawing Index', update=refreshActiveDrawingIndex)
|
||||
current_drawing_index: IntProperty(name='Current Drawing Index')
|
||||
schedules: CollectionProperty(name='Schedules', type=Schedule)
|
||||
active_schedule_index: IntProperty(name='Active Schedule Index')
|
||||
|
||||
@@ -740,8 +740,6 @@ class BIM_PT_drawings(Panel):
|
||||
if props.drawings:
|
||||
op = row.operator('bim.open_view', icon='URL', text='')
|
||||
op.view = props.drawings[props.active_drawing_index].name
|
||||
op = row.operator('bim.activate_view', icon='SCENE', text='')
|
||||
op.drawing_index = props.active_drawing_index
|
||||
row.operator('bim.remove_drawing', icon='X', text='').index = props.active_drawing_index
|
||||
|
||||
layout.template_list('BIM_UL_generic', '', props, 'drawings', props, 'active_drawing_index')
|
||||
@@ -1961,6 +1959,17 @@ class BIM_PT_annotation_utilities(Panel):
|
||||
op.obj_name = 'Section Level'
|
||||
op.data_type = 'curve'
|
||||
|
||||
props = bpy.context.scene.DocProperties
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator('bim.add_drawing')
|
||||
|
||||
if props.drawings:
|
||||
op = row.operator('bim.open_view', icon='URL', text='')
|
||||
op.view = props.drawings[props.active_drawing_index].name
|
||||
row.operator('bim.remove_drawing', icon='X', text='').index = props.active_drawing_index
|
||||
|
||||
layout.template_list('BIM_UL_generic', '', props, 'drawings', props, 'active_drawing_index')
|
||||
|
||||
|
||||
class BIM_PT_qto_utilities(Panel):
|
||||
|
||||
Reference in New Issue
Block a user