New feature to unassign/reassign IFC class easily

This commit is contained in:
Dion Moult
2020-06-23 23:42:33 +10:00
parent da7ba7b1e9
commit 3e9fff6c19
3 changed files with 42 additions and 14 deletions
+21 -13
View File
@@ -20,20 +20,26 @@ class BIM_PT_object(Panel):
props = context.active_object.BIMObjectProperties
bim_properties = context.scene.BIMProperties
row = layout.row()
row.prop(bim_properties, "ifc_product")
row = layout.row()
row.prop(bim_properties, "ifc_class")
if bim_properties.ifc_predefined_type:
row = layout.row()
row.prop(bim_properties, "ifc_predefined_type")
if bim_properties.ifc_predefined_type == 'USERDEFINED':
row = layout.row()
row.prop(bim_properties, "ifc_userdefined_type")
row = layout.row(align=True)
if 'Ifc' not in context.active_object.name:
row = layout.row()
row.prop(bim_properties, "ifc_product")
row = layout.row()
row.prop(bim_properties, "ifc_class")
if bim_properties.ifc_predefined_type:
row = layout.row()
row.prop(bim_properties, "ifc_predefined_type")
if bim_properties.ifc_predefined_type == 'USERDEFINED':
row = layout.row()
row.prop(bim_properties, "ifc_userdefined_type")
row = layout.row()
op = row.operator("bim.assign_class")
op.object_name = context.active_object.name
else:
op = row.operator("bim.assign_class", text='Reassign IFC Class')
op.object_name = context.active_object.name
op = row.operator("bim.unassign_class", icon='X', text='')
op.object_name = context.active_object.name
if 'Ifc' not in context.active_object.name:
return
layout.label(text="Software Identity:")
@@ -845,9 +851,11 @@ class BIM_PT_bim(Panel):
if bim_properties.ifc_predefined_type == 'USERDEFINED':
row = layout.row()
row.prop(bim_properties, "ifc_userdefined_type")
row = layout.row()
row = layout.row(align=True)
op = row.operator("bim.assign_class")
op.object_name = ''
op = row.operator("bim.unassign_class", icon='X', text='')
op.object_name = ''
row = layout.row(align=True)
row.operator("bim.select_class")