From 1512947c833d817689dce7ef92076996a48b4ecf Mon Sep 17 00:00:00 2001 From: Massimo Fabbro Date: Sat, 7 Mar 2026 22:10:53 +0100 Subject: [PATCH] See #7716. Remove_cost_item also delete the assignment Previously remove_cost_item leaved orphaned relation now it should be fixed --- .../ifcopenshell/api/cost/remove_cost_item.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/cost/remove_cost_item.py b/src/ifcopenshell-python/ifcopenshell/api/cost/remove_cost_item.py index ce1aa5545e..9b90cce2e8 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/cost/remove_cost_item.py +++ b/src/ifcopenshell-python/ifcopenshell/api/cost/remove_cost_item.py @@ -51,7 +51,7 @@ def remove_cost_item(file: ifcopenshell.file, cost_item: ifcopenshell.entity_ins if history: ifcopenshell.util.element.remove_deep2(file, history) elif inverse.is_a("IfcRelAssignsToControl"): - if len(inverse.RelatedObjects) >= 2 or inverse.RelatingControl == cost_item: + if len(inverse.RelatedObjects) >= 2: continue history = inverse.OwnerHistory file.remove(inverse)