mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 02:47:48 +00:00
Fix error toggling boundary decorations after one was removed #6088
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user