From 7be21bf02e8287e4bb94259195421d67f256abae Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 19 Dec 2024 17:46:34 +0500 Subject: [PATCH] mep - fix errors adding a bend/a transition mesh is already removed by replace_object_ifc_representation --- src/bonsai/bonsai/bim/module/model/mep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/model/mep.py b/src/bonsai/bonsai/bim/module/model/mep.py index 8886036cdd..f4c00fb53b 100644 --- a/src/bonsai/bonsai/bim/module/model/mep.py +++ b/src/bonsai/bonsai/bim/module/model/mep.py @@ -846,8 +846,8 @@ class MEPAddTransition(bpy.types.Operator, tool.Ifc.Operator): should_add_representation=False, ) body = ifcopenshell.util.representation.get_context(ifc_file, "Model", "Body", "MODEL_VIEW") + # Will implicitly remove `mesh`. tool.Model.replace_object_ifc_representation(body, obj, rep) - tool.Blender.remove_data_block(mesh) pset = ifcopenshell.api.run("pset.add_pset", tool.Ifc.get(), product=transition_type, name="BBIM_Fitting") ifcopenshell.api.run( "pset.edit_pset", @@ -1197,8 +1197,8 @@ class MEPAddBend(bpy.types.Operator, tool.Ifc.Operator): should_add_representation=False, ) body = ifcopenshell.util.representation.get_context(ifc_file, "Model", "Body", "MODEL_VIEW") + # Will implicitly remove `mesh`. tool.Model.replace_object_ifc_representation(body, obj, rep) - tool.Blender.remove_data_block(mesh) pset = ifcopenshell.api.run("pset.add_pset", tool.Ifc.get(), product=bend_type, name="BBIM_Fitting") ifcopenshell.api.run( "pset.edit_pset",