diff --git a/src/bonsai/bonsai/bim/module/model/opening.py b/src/bonsai/bonsai/bim/module/model/opening.py index 1fbe7f1c4f..0bd80c626c 100644 --- a/src/bonsai/bonsai/bim/module/model/opening.py +++ b/src/bonsai/bonsai/bim/module/model/opening.py @@ -824,7 +824,17 @@ class ShowOpenings(Operator, tool.Ifc.Operator): def _execute(self, context): props = bpy.context.scene.BIMModelProperties - for obj in context.selected_objects: + objs = context.selected_objects + + #add the obj's aggregate, as well, to objs + for obj in objs: + element = tool.Ifc.get_entity(obj) + if element and getattr(element, "Decomposes", None): + if element.Decomposes and (aggregate := element.Decomposes[0].RelatingObject): + aggregate_obj = tool.Ifc.get_object(aggregate) + objs.append(aggregate_obj) + + for obj in objs: element = tool.Ifc.get_entity(obj) if not element or not getattr(element, "HasOpenings", None): continue diff --git a/src/bonsai/bonsai/bim/module/model/workspace.py b/src/bonsai/bonsai/bim/module/model/workspace.py index 9fe00209c1..9ee9664bdc 100644 --- a/src/bonsai/bonsai/bim/module/model/workspace.py +++ b/src/bonsai/bonsai/bim/module/model/workspace.py @@ -1258,14 +1258,11 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator): bpy.ops.bim.enable_editing_extrusion_axis() def hotkey_A_O(self): - if ( - AuthoringData.data["has_visible_openings"] - or not bpy.context.selected_objects - or AuthoringData.data["active_class"] == "IfcOpeningElement" - ): + opening_collection = bpy.data.collections.get("IfcOpeningElement") + if opening_collection and opening_collection.objects: bpy.ops.bim.edit_openings() else: - bpy.ops.bim.show_openings() + bpy.ops.bim.show_openings() custom_icon_previews = None