Switch between drawings with one click, with access from the 3D view

This commit is contained in:
Dion Moult
2020-09-07 17:08:04 +10:00
parent 24c00c0235
commit 36bd903736
2 changed files with 16 additions and 3 deletions
+5 -1
View File
@@ -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')
+11 -2
View File
@@ -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):