Simple UI to display repr item shape aspect

Example - https://i.imgur.com/YEAE9zU.png
This commit is contained in:
Andrej730
2024-01-26 14:21:45 +05:00
parent 7cb08a93a8
commit bd5c650774
3 changed files with 12 additions and 3 deletions
@@ -1597,6 +1597,10 @@ class EnableEditingRepresentationItems(bpy.types.Operator, Operator):
new.surface_style = style.Name or "Unnamed"
elif inverse.is_a("IfcPresentationLayerAssignment"):
new.layer = inverse.Name or "Unnamed"
elif inverse.is_a("IfcShapeRepresentation"):
if inverse.OfShapeAspect:
shape_aspect = inverse.OfShapeAspect[0]
new.shape_aspect = shape_aspect.Name
class DisableEditingRepresentationItems(bpy.types.Operator, Operator):
@@ -61,6 +61,7 @@ class RepresentationItem(PropertyGroup):
surface_style: StringProperty(name="Surface Style")
layer: StringProperty(name="Layer")
ifc_definition_id: IntProperty(name="IFC Definition ID")
shape_aspect: StringProperty(name="Shape Aspect")
class BIMObjectGeometryProperties(PropertyGroup):
@@ -190,8 +190,9 @@ class BIM_PT_representation_items(Panel):
if not item_is_active:
return
surface_style = props.items[props.active_item_index].surface_style
presentation_layer = props.items[props.active_item_index].layer
active_item = props.items[props.active_item_index]
surface_style = active_item.surface_style
shape_aspect = active_item.shape_aspect
row = self.layout.row(align=True)
if props.is_editing_item_style:
@@ -210,7 +211,10 @@ class BIM_PT_representation_items(Panel):
row.operator("bim.unassign_representation_item_style", icon="X", text="")
row = self.layout.row()
row.label(text=presentation_layer or "No Presentation Layer", icon="STICKY_UVS_LOC")
row.label(text=active_item.layer or "No Presentation Layer", icon="STICKY_UVS_LOC")
row = self.layout.row()
row.label(text=shape_aspect or "No Shape Aspect", icon="SHAPEKEY_DATA")
class BIM_PT_connections(Panel):