mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 01:47:55 +00:00
Simplify UI by making GlobalId generation more automated and show in context
This commit is contained in:
@@ -1122,6 +1122,8 @@ class AddAttribute(bpy.types.Operator):
|
|||||||
if bpy.context.active_object.BIMObjectProperties.applicable_attributes:
|
if bpy.context.active_object.BIMObjectProperties.applicable_attributes:
|
||||||
attribute = bpy.context.active_object.BIMObjectProperties.attributes.add()
|
attribute = bpy.context.active_object.BIMObjectProperties.attributes.add()
|
||||||
attribute.name = bpy.context.active_object.BIMObjectProperties.applicable_attributes
|
attribute.name = bpy.context.active_object.BIMObjectProperties.applicable_attributes
|
||||||
|
if attribute.name == 'GlobalId':
|
||||||
|
attribute.string_value = ifcopenshell.guid.new()
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,10 +41,6 @@ class BIM_PT_object(Panel):
|
|||||||
if 'Ifc' not in context.active_object.name:
|
if 'Ifc' not in context.active_object.name:
|
||||||
return
|
return
|
||||||
|
|
||||||
layout.label(text="Software Identity:")
|
|
||||||
row = layout.row()
|
|
||||||
row.operator('bim.generate_global_id')
|
|
||||||
|
|
||||||
layout.label(text="Attributes:")
|
layout.label(text="Attributes:")
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(props, 'applicable_attributes', text='')
|
row.prop(props, 'applicable_attributes', text='')
|
||||||
@@ -54,6 +50,8 @@ class BIM_PT_object(Panel):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(attribute, 'name', text='')
|
row.prop(attribute, 'name', text='')
|
||||||
row.prop(attribute, 'string_value', 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 = row.operator('bim.copy_attributes_to_selection', icon='COPYDOWN', text='')
|
||||||
op.prop_base = 'BIMObjectProperties.attributes'
|
op.prop_base = 'BIMObjectProperties.attributes'
|
||||||
op.prop_name = attribute.name
|
op.prop_name = attribute.name
|
||||||
|
|||||||
Reference in New Issue
Block a user