mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 23:29:59 +00:00
fix #3834. Now clone opening produces valid IFC files
This commit is contained in:
@@ -782,7 +782,7 @@ class EditOpenings(Operator, tool.Ifc.Operator):
|
|||||||
element = similar_opening.VoidsElements[0].RelatingBuildingElement
|
element = similar_opening.VoidsElements[0].RelatingBuildingElement
|
||||||
obj = tool.Ifc.get_object(element)
|
obj = tool.Ifc.get_object(element)
|
||||||
building_objs.add(obj)
|
building_objs.add(obj)
|
||||||
|
|
||||||
building_objs.update(self.get_all_building_objects_of_similar_openings(opening))
|
building_objs.update(self.get_all_building_objects_of_similar_openings(opening))
|
||||||
tool.Ifc.unlink(element=opening, obj=opening_obj)
|
tool.Ifc.unlink(element=opening, obj=opening_obj)
|
||||||
bpy.data.objects.remove(opening_obj)
|
bpy.data.objects.remove(opening_obj)
|
||||||
@@ -826,13 +826,10 @@ class CloneOpening(Operator, tool.Ifc.Operator):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
opening_placement = opening.ObjectPlacement
|
opening_placement = opening.ObjectPlacement
|
||||||
opening_representations = opening.Representation.Representations
|
opening_representation = opening.Representation
|
||||||
|
|
||||||
new_opening = ifcopenshell.api.run("root.create_entity", tool.Ifc.get(), ifc_class="IfcOpeningElement")
|
new_opening = ifcopenshell.api.run("root.create_entity", tool.Ifc.get(), ifc_class="IfcOpeningElement")
|
||||||
for representation in opening_representations:
|
new_opening.Representation = opening_representation
|
||||||
ifcopenshell.api.run(
|
|
||||||
"geometry.assign_representation", tool.Ifc.get(), product=new_opening, representation=representation
|
|
||||||
)
|
|
||||||
|
|
||||||
ifcopenshell.api.run("void.add_opening", tool.Ifc.get(), opening=new_opening, element=wall)
|
ifcopenshell.api.run("void.add_opening", tool.Ifc.get(), opening=new_opening, element=wall)
|
||||||
new_opening.ObjectPlacement = opening_placement
|
new_opening.ObjectPlacement = opening_placement
|
||||||
|
|||||||
Reference in New Issue
Block a user