Fix error toggling boundary decorations after one was removed #6088

This commit is contained in:
Andrej730
2025-02-04 12:23:29 +05:00
parent d4f44cb0a1
commit 7ec1bc5272
3 changed files with 7 additions and 1 deletions
@@ -70,7 +70,7 @@ class BIMObjectBoundaryProperties(PropertyGroup):
class BIMBoundaryProperties(PropertyGroup):
boundaries: bpy.props.CollectionProperty(type=ObjProperty)
boundaries: bpy.props.CollectionProperty(type=ObjProperty, description="Decorated boundaries")
if TYPE_CHECKING:
boundaries: bpy.types.bpy_prop_collection_idprop[ObjProperty]
+5
View File
@@ -96,3 +96,8 @@ class Boundary(bonsai.core.tool.Boundary):
@classmethod
def undecorate_boundary(cls, obj: bpy.types.Object) -> None:
obj.show_in_front = False
props = cls.get_boundary_props()
for i in reversed(range(len(props.boundaries))):
if props.boundaries[i].obj == obj:
props.boundaries.remove(i)
break
+1
View File
@@ -195,6 +195,7 @@ class Geometry(bonsai.core.tool.Geometry):
return bonsai.core.drawing.remove_drawing(tool.Ifc, tool.Drawing, drawing=element)
elif element.is_a("IfcRelSpaceBoundary"):
ifcopenshell.api.run("boundary.remove_boundary", tool.Ifc.get(), boundary=element)
tool.Boundary.undecorate_boundary(obj)
return bpy.data.objects.remove(obj)
elif element.is_a("IfcGridAxis"):
is_last_axis = False