diff --git a/src/bonsai/bonsai/bim/module/aggregate/data.py b/src/bonsai/bonsai/bim/module/aggregate/data.py index 5b609654ea..ad58f6defb 100644 --- a/src/bonsai/bonsai/bim/module/aggregate/data.py +++ b/src/bonsai/bonsai/bim/module/aggregate/data.py @@ -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( ( diff --git a/src/bonsai/bonsai/bim/module/aggregate/ui.py b/src/bonsai/bonsai/bim/module/aggregate/ui.py index 4074c7fc2b..e9c596f9ac 100644 --- a/src/bonsai/bonsai/bim/module/aggregate/ui.py +++ b/src/bonsai/bonsai/bim/module/aggregate/ui.py @@ -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")