Be able to close openings no matter what is selected.

This commit is contained in:
Ryan Schultz
2024-12-29 16:07:56 -06:00
parent c562a2c2ac
commit 78afcf9c7a
2 changed files with 8 additions and 5 deletions
@@ -881,8 +881,9 @@ class EditOpenings(Operator, tool.Ifc.Operator):
def _execute(self, context):
props = bpy.context.scene.BIMModelProperties
building_objs = set()
current_openings = bpy.data.collections.get("IfcOpeningElement").objects
for obj in context.selected_objects:
for obj in current_openings:
element = tool.Ifc.get_entity(obj)
if not element:
continue
@@ -1258,12 +1258,14 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
bpy.ops.bim.enable_editing_extrusion_axis()
def hotkey_A_O(self):
if not bpy.context.selected_objects:
return
if AuthoringData.data["has_visible_openings"]:
if (
AuthoringData.data["has_visible_openings"]
or not bpy.context.selected_objects
or AuthoringData.data["active_class"] == "IfcOpeningElement"
):
bpy.ops.bim.edit_openings()
else:
bpy.ops.bim.show_openings()
bpy.ops.bim.show_openings()
custom_icon_previews = None