mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Toggle openings for part's aggregate as well.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user