From 9aad2495862a4da99718a3bd6213a119e7c68abc Mon Sep 17 00:00:00 2001 From: Massimo Fabbro Date: Sat, 2 Dec 2023 17:38:28 +0100 Subject: [PATCH] fix #3834. Now clone opening produces valid IFC files --- src/blenderbim/blenderbim/bim/module/model/opening.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/model/opening.py b/src/blenderbim/blenderbim/bim/module/model/opening.py index 5e7579ce86..b0dd62e26a 100644 --- a/src/blenderbim/blenderbim/bim/module/model/opening.py +++ b/src/blenderbim/blenderbim/bim/module/model/opening.py @@ -782,7 +782,7 @@ class EditOpenings(Operator, tool.Ifc.Operator): element = similar_opening.VoidsElements[0].RelatingBuildingElement obj = tool.Ifc.get_object(element) building_objs.add(obj) - + building_objs.update(self.get_all_building_objects_of_similar_openings(opening)) tool.Ifc.unlink(element=opening, obj=opening_obj) bpy.data.objects.remove(opening_obj) @@ -826,13 +826,10 @@ class CloneOpening(Operator, tool.Ifc.Operator): continue 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") - for representation in opening_representations: - ifcopenshell.api.run( - "geometry.assign_representation", tool.Ifc.get(), product=new_opening, representation=representation - ) + new_opening.Representation = opening_representation ifcopenshell.api.run("void.add_opening", tool.Ifc.get(), opening=new_opening, element=wall) new_opening.ObjectPlacement = opening_placement