mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +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:
@@ -59,6 +59,6 @@ def edit_cost_value(
|
||||
value["ValueComponent"],
|
||||
)
|
||||
value = file.create_entity("IfcMeasureWithUnit", value_component, value["UnitComponent"])
|
||||
if old_unit_basis and file.get_total_inverses(old_unit_basis) == 0:
|
||||
ifcopenshell.util.element.remove_deep(file, old_unit_basis)
|
||||
if old_unit_basis:
|
||||
ifcopenshell.util.element.remove_deep2(file, old_unit_basis)
|
||||
setattr(cost_value, name, value)
|
||||
|
||||
Reference in New Issue
Block a user