Allow "Refresh Linked Aggregate" to be called when uppermost aggregate is selected.

This commit is contained in:
Bruno Perdigão
2025-07-16 17:43:55 -03:00
parent b305e2354b
commit dd14f33c0b
2 changed files with 7 additions and 4 deletions
@@ -71,11 +71,14 @@ class AggregateData:
@classmethod
def total_linked_aggregate(cls) -> Union[int, None]:
element = tool.Ifc.get_entity(bpy.context.active_object)
aggregate = ifcopenshell.util.element.get_aggregate(element)
if not aggregate:
return
if not element:
return
aggregate = ifcopenshell.util.element.get_aggregate(element)
parts = ifcopenshell.util.element.get_parts(element)
if not aggregate and not parts:
return
if parts:
aggregate = element
product_linked_agg_group = next(
(
+1 -1
View File
@@ -136,7 +136,7 @@ class BIM_PT_linked_aggregate(Panel):
assert (element := tool.Ifc.get_entity(obj))
row = layout.row(align=True)
if element.Decomposes:
if element.Decomposes or element.IsDecomposedBy:
Number_Linked_Aggregates = AggregateData.data["total_linked_aggregate"]
if not Number_Linked_Aggregates:
row.label(text="Not a Linked Aggregate")