mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 01:47:55 +00:00
fixes #3908: Close the opening (bim.edit_openings) while having the opening selected
This commit is contained in:
@@ -732,6 +732,9 @@ class HideOpenings(Operator, tool.Ifc.Operator):
|
|||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
if not element:
|
if not element:
|
||||||
continue
|
continue
|
||||||
|
if element.is_a("IfcOpeningElement"):
|
||||||
|
element = element.VoidsElements[0].RelatingBuildingElement
|
||||||
|
obj = tool.Ifc.get_object(element)
|
||||||
openings = [r.RelatedOpeningElement for r in element.HasOpenings]
|
openings = [r.RelatedOpeningElement for r in element.HasOpenings]
|
||||||
for opening in openings:
|
for opening in openings:
|
||||||
opening_obj = tool.Ifc.get_object(opening)
|
opening_obj = tool.Ifc.get_object(opening)
|
||||||
@@ -759,6 +762,9 @@ class EditOpenings(Operator, tool.Ifc.Operator):
|
|||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
if not element:
|
if not element:
|
||||||
continue
|
continue
|
||||||
|
if element.is_a("IfcOpeningElement"):
|
||||||
|
element = element.VoidsElements[0].RelatingBuildingElement
|
||||||
|
obj = tool.Ifc.get_object(element)
|
||||||
openings = [r.RelatedOpeningElement for r in element.HasOpenings]
|
openings = [r.RelatedOpeningElement for r in element.HasOpenings]
|
||||||
for opening in openings:
|
for opening in openings:
|
||||||
similar_openings = [o for o in all_openings if o.ObjectPlacement == opening.ObjectPlacement]
|
similar_openings = [o for o in all_openings if o.ObjectPlacement == opening.ObjectPlacement]
|
||||||
|
|||||||
@@ -427,11 +427,14 @@ class BimToolUI:
|
|||||||
row.operator("bim.show_openings", icon="HIDE_OFF", text="")
|
row.operator("bim.show_openings", icon="HIDE_OFF", text="")
|
||||||
|
|
||||||
if AuthoringData.data["active_class"] in ("IfcOpeningElement",):
|
if AuthoringData.data["active_class"] in ("IfcOpeningElement",):
|
||||||
|
row.operator("bim.edit_openings", icon="CHECKMARK", text="")
|
||||||
|
row.operator("bim.hide_openings", icon="CANCEL", text="")
|
||||||
if len(context.selected_objects) == 2:
|
if len(context.selected_objects) == 2:
|
||||||
row = cls.layout.row(align=True)
|
row = cls.layout.row(align=True)
|
||||||
row.label(text="", icon="EVENT_SHIFT")
|
row.label(text="", icon="EVENT_SHIFT")
|
||||||
row.label(text="", icon="EVENT_L")
|
row.label(text="", icon="EVENT_L")
|
||||||
row.operator("bim.clone_opening", text="Clone Opening")
|
row.operator("bim.clone_opening", text="Clone Opening")
|
||||||
|
|
||||||
|
|
||||||
cls.layout.row(align=True).label(text="Align")
|
cls.layout.row(align=True).label(text="Align")
|
||||||
add_layout_hotkey_operator(cls.layout, "Align Exterior", "S_X", "")
|
add_layout_hotkey_operator(cls.layout, "Align Exterior", "S_X", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user