mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Migrate remove_deep to remove_deep2 across API modules
remove_deep is deprecated and can silently delete elements still in use. remove_deep2 requires zero inverses before removal, making it safer. Also fixes a double-removal bug in remove_grid_axis and prevents removing the last prop template from a pset template. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -79,5 +79,5 @@ def add_resource_quantity(
|
||||
old_quantity = resource.BaseQuantity
|
||||
resource.BaseQuantity = quantity
|
||||
if old_quantity:
|
||||
ifcopenshell.util.element.remove_deep(file, old_quantity)
|
||||
ifcopenshell.util.element.remove_deep2(file, old_quantity)
|
||||
return quantity
|
||||
|
||||
@@ -47,4 +47,4 @@ def remove_resource_quantity(file: ifcopenshell.file, resource: ifcopenshell.ent
|
||||
old_quantity = resource.BaseQuantity
|
||||
resource.BaseQuantity = None
|
||||
if old_quantity:
|
||||
ifcopenshell.util.element.remove_deep(file, old_quantity)
|
||||
ifcopenshell.util.element.remove_deep2(file, old_quantity)
|
||||
|
||||
Reference in New Issue
Block a user