mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Fix error refresh linked aggregate with 2+ levels of aggregates #5911
Error occurred if IfcElementAssembly, that was currently refreshed, had another IfcElementAssembly as it's part. Then, it was removed twice - once during delete_objects and another time during delete_ifc_object, leading to the error.
This commit is contained in:
@@ -1402,11 +1402,13 @@ class RefreshLinkedAggregate(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
original_names: dict[int, dict[int, str]] = {}
|
original_names: dict[int, dict[int, str]] = {}
|
||||||
|
|
||||||
def delete_objects(element: ifcopenshell.entity_instance) -> None:
|
def delete_objects(element: ifcopenshell.entity_instance) -> None:
|
||||||
|
"""Remove IfcElementAssembly and it's parts."""
|
||||||
parts = ifcopenshell.util.element.get_parts(element)
|
parts = ifcopenshell.util.element.get_parts(element)
|
||||||
if parts:
|
if parts:
|
||||||
for part in parts:
|
for part in parts:
|
||||||
if part.is_a("IfcElementAssembly"):
|
if part.is_a("IfcElementAssembly"):
|
||||||
delete_objects(part)
|
delete_objects(part)
|
||||||
|
continue
|
||||||
|
|
||||||
tool.Geometry.delete_ifc_object(tool.Ifc.get_object(part))
|
tool.Geometry.delete_ifc_object(tool.Ifc.get_object(part))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user