mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +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]] = {}
|
||||
|
||||
def delete_objects(element: ifcopenshell.entity_instance) -> None:
|
||||
"""Remove IfcElementAssembly and it's parts."""
|
||||
parts = ifcopenshell.util.element.get_parts(element)
|
||||
if parts:
|
||||
for part in parts:
|
||||
if part.is_a("IfcElementAssembly"):
|
||||
delete_objects(part)
|
||||
continue
|
||||
|
||||
tool.Geometry.delete_ifc_object(tool.Ifc.get_object(part))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user