diff --git a/src/ifcblenderexport/blenderbim/bim/prop.py b/src/ifcblenderexport/blenderbim/bim/prop.py index e87cff3ea9..2e7fe79a54 100644 --- a/src/ifcblenderexport/blenderbim/bim/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/prop.py @@ -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') diff --git a/src/ifcblenderexport/blenderbim/bim/ui.py b/src/ifcblenderexport/blenderbim/bim/ui.py index f39c77c51d..d8db556fea 100644 --- a/src/ifcblenderexport/blenderbim/bim/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/ui.py @@ -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):