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
@@ -123,7 +123,7 @@ def assign_object(
related_objects = set(decomposes.RelatedObjects) - products_set
if related_objects:
decomposes.RelatedObjects = list(related_objects)
ifcopenshell.api.owner.update_owner_history(file, **{"element": decomposes})
ifcopenshell.api.owner.update_owner_history(file, element=decomposes)
else:
history = decomposes.OwnerHistory
file.remove(decomposes)
@@ -133,7 +133,7 @@ def assign_object(
# assign elements to a new aggregate
if is_decomposed_by:
is_decomposed_by.RelatedObjects = list(set(is_decomposed_by.RelatedObjects) | products_set)
ifcopenshell.api.owner.update_owner_history(file, **{"element": is_decomposed_by})
ifcopenshell.api.owner.update_owner_history(file, element=is_decomposed_by)
else:
is_decomposed_by = file.create_entity(
"IfcRelAggregates",
@@ -69,7 +69,7 @@ def unassign_object(file: ifcopenshell.file, products: list[ifcopenshell.entity_
related_objects = set(rel.RelatedObjects) - products
if related_objects:
rel.RelatedObjects = list(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)