mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +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):
|
class BIMBoundaryProperties(PropertyGroup):
|
||||||
boundaries: bpy.props.CollectionProperty(type=ObjProperty)
|
boundaries: bpy.props.CollectionProperty(type=ObjProperty, description="Decorated boundaries")
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
boundaries: bpy.types.bpy_prop_collection_idprop[ObjProperty]
|
boundaries: bpy.types.bpy_prop_collection_idprop[ObjProperty]
|
||||||
|
|||||||
@@ -96,3 +96,8 @@ class Boundary(bonsai.core.tool.Boundary):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def undecorate_boundary(cls, obj: bpy.types.Object) -> None:
|
def undecorate_boundary(cls, obj: bpy.types.Object) -> None:
|
||||||
obj.show_in_front = False
|
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)
|
return bonsai.core.drawing.remove_drawing(tool.Ifc, tool.Drawing, drawing=element)
|
||||||
elif element.is_a("IfcRelSpaceBoundary"):
|
elif element.is_a("IfcRelSpaceBoundary"):
|
||||||
ifcopenshell.api.run("boundary.remove_boundary", tool.Ifc.get(), boundary=element)
|
ifcopenshell.api.run("boundary.remove_boundary", tool.Ifc.get(), boundary=element)
|
||||||
|
tool.Boundary.undecorate_boundary(obj)
|
||||||
return bpy.data.objects.remove(obj)
|
return bpy.data.objects.remove(obj)
|
||||||
elif element.is_a("IfcGridAxis"):
|
elif element.is_a("IfcGridAxis"):
|
||||||
is_last_axis = False
|
is_last_axis = False
|
||||||
|
|||||||
Reference in New Issue
Block a user