ifcopenshell.api.run to use explicit kwargs instead of unpacking

This commit is contained in:
Andrej
2025-06-10 11:02:54 +05:00
parent a37d46ca3d
commit 1608677d40
52 changed files with 118 additions and 147 deletions
@@ -146,7 +146,7 @@ def assign_object(
cur_related_objects = [o for o in nests.RelatedObjects if o not in related_objects_set]
if cur_related_objects:
nests.RelatedObjects = list(cur_related_objects)
ifcopenshell.api.owner.update_owner_history(file, **{"element": nests})
ifcopenshell.api.owner.update_owner_history(file, element=nests)
else:
history = nests.OwnerHistory
file.remove(nests)
@@ -160,7 +160,7 @@ def assign_object(
is_nested_by.RelatedObjects = cur_related_objects + [
o for o in related_objects if o not in cur_related_objects_set
]
ifcopenshell.api.owner.update_owner_history(file, **{"element": is_nested_by})
ifcopenshell.api.owner.update_owner_history(file, element=is_nested_by)
else:
is_nested_by = file.create_entity(
"IfcRelNests",
@@ -33,7 +33,7 @@ def change_nest(
related_objects.remove(item)
if related_objects:
nests.RelatedObjects = related_objects
ifcopenshell.api.owner.update_owner_history(file, **{"element": nests})
ifcopenshell.api.owner.update_owner_history(file, element=nests)
else:
history = nests.OwnerHistory
file.remove(nests)
@@ -66,7 +66,7 @@ def unassign_object(file: ifcopenshell.file, related_objects: list[ifcopenshell.
cur_related_objects = [o for o in rel.RelatedObjects if o not in related_objects_set]
if cur_related_objects:
rel.RelatedObjects = cur_related_objects
ifcopenshell.api.owner.update_owner_history(file, **{"element": rel})
ifcopenshell.api.owner.update_owner_history(file, element=rel)
else:
history = rel.OwnerHistory
file.remove(rel)