mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
len(get_inverse) -> get_total_inverses
This commit is contained in:
@@ -58,6 +58,6 @@ def edit_cost_value(
|
||||
value["ValueComponent"],
|
||||
)
|
||||
value = file.create_entity("IfcMeasureWithUnit", value_component, value["UnitComponent"])
|
||||
if old_unit_basis and len(file.get_inverse(old_unit_basis)) == 0:
|
||||
if old_unit_basis and file.get_total_inverses(old_unit_basis) == 0:
|
||||
ifcopenshell.util.element.remove_deep(file, old_unit_basis)
|
||||
setattr(cost_value, name, value)
|
||||
|
||||
@@ -43,7 +43,7 @@ def remove_cost_item_quantity(
|
||||
ifcopenshell.api.cost.remove_cost_item(model,
|
||||
cost_item=item, physical_quantity=quantity)
|
||||
"""
|
||||
if len(file.get_inverse(physical_quantity)) == 1:
|
||||
if file.get_total_inverses(physical_quantity) == 1:
|
||||
file.remove(physical_quantity)
|
||||
return
|
||||
quantities = list(cost_item.CostQuantities or [])
|
||||
|
||||
@@ -45,7 +45,7 @@ def remove_cost_value(
|
||||
|
||||
ifcopenshell.api.cost.remove_cost_value(model, parent=item, cost_value=value)
|
||||
"""
|
||||
if len(file.get_inverse(cost_value)) == 1:
|
||||
if file.get_total_inverses(cost_value) == 1:
|
||||
file.remove(cost_value)
|
||||
# TODO deep purge
|
||||
elif parent.is_a("IfcCostItem"):
|
||||
|
||||
Reference in New Issue
Block a user