Simplify UI by making GlobalId generation more automated and show in context

This commit is contained in:
Dion Moult
2020-08-09 11:21:00 +10:00
parent 09af3b052b
commit be4fe1b684
2 changed files with 4 additions and 4 deletions
@@ -1122,6 +1122,8 @@ class AddAttribute(bpy.types.Operator):
if bpy.context.active_object.BIMObjectProperties.applicable_attributes:
attribute = bpy.context.active_object.BIMObjectProperties.attributes.add()
attribute.name = bpy.context.active_object.BIMObjectProperties.applicable_attributes
if attribute.name == 'GlobalId':
attribute.string_value = ifcopenshell.guid.new()
return {'FINISHED'}
+2 -4
View File
@@ -41,10 +41,6 @@ class BIM_PT_object(Panel):
if 'Ifc' not in context.active_object.name:
return
layout.label(text="Software Identity:")
row = layout.row()
row.operator('bim.generate_global_id')
layout.label(text="Attributes:")
row = layout.row(align=True)
row.prop(props, 'applicable_attributes', text='')
@@ -54,6 +50,8 @@ class BIM_PT_object(Panel):
row = layout.row(align=True)
row.prop(attribute, 'name', text='')
row.prop(attribute, 'string_value', text='')
if attribute.name == 'GlobalId':
row.operator('bim.generate_global_id', icon='FILE_REFRESH', text='')
op = row.operator('bim.copy_attributes_to_selection', icon='COPYDOWN', text='')
op.prop_base = 'BIMObjectProperties.attributes'
op.prop_name = attribute.name