len(get_inverse) -> get_total_inverses

This commit is contained in:
Andrej730
2025-02-24 11:34:47 +05:00
parent 6eda4e389c
commit 5eb9cb2ee4
17 changed files with 26 additions and 26 deletions
@@ -38,10 +38,10 @@ def remove_organisation(file: ifcopenshell.file, organisation: ifcopenshell.enti
ifcopenshell.api.owner.remove_organisation(model, organisation=organisation)
"""
for role in organisation.Roles or []:
if len(file.get_inverse(role)) == 1:
if (file.get_total_inverses(role)) == 1:
ifcopenshell.api.owner.remove_role(file, role=role)
for address in organisation.Addresses or []:
if len(file.get_inverse(address)) == 1:
if (file.get_total_inverses(address)) == 1:
ifcopenshell.api.owner.remove_address(file, address=address)
for inverse in file.get_inverse(organisation):
if inverse.is_a("IfcOrganizationRelationship"):
@@ -41,10 +41,10 @@ def remove_person(file: ifcopenshell.file, person: ifcopenshell.entity_instance)
"""
for role in person.Roles or []:
if len(file.get_inverse(role)) == 1:
if file.get_total_inverses(role) == 1:
ifcopenshell.api.owner.remove_role(file, role=role)
for address in person.Addresses or []:
if len(file.get_inverse(address)) == 1:
if file.get_total_inverses(address) == 1:
ifcopenshell.api.owner.remove_address(file, address=address)
for inverse in file.get_inverse(person):
if inverse.is_a("IfcWorkControl"):