control.unassign_control to support batching

This commit is contained in:
Andrej730
2025-09-09 14:40:42 +05:00
parent abfb56350d
commit a9c0c1f4ba
8 changed files with 32 additions and 28 deletions
+2 -5
View File
@@ -154,10 +154,7 @@ def unassign_cost_item_type(
"""
if not product_types:
product_types = list(spatial.get_selected_product_types())
[
ifc.run("control.unassign_control", relating_control=cost_item, related_object=product_type)
for product_type in product_types
]
ifc.run("control.unassign_control", relating_control=cost_item, related_objects=product_types)
cost.load_cost_item_types(cost_item)
return product_types
@@ -213,7 +210,7 @@ def assign_cost_value(
if existing_cost_rate is None:
ifc.run("control.assign_control", relating_control=cost_rate, related_objects=[cost_item])
else:
ifc.run("control.unassign_control", relating_control=existing_cost_rate, related_object=cost_item)
ifc.run("control.unassign_control", relating_control=existing_cost_rate, related_objects=[cost_item])
ifc.run("control.assign_control", relating_control=cost_rate, related_objects=[cost_item])
+1 -1
View File
@@ -433,7 +433,7 @@ def remove_task_calendar(
task: ifcopenshell.entity_instance,
work_calendar: ifcopenshell.entity_instance,
) -> None:
ifc.run("control.unassign_control", relating_control=work_calendar, related_object=task)
ifc.run("control.unassign_control", relating_control=work_calendar, related_objects=[task])
ifc.run("sequence.cascade_schedule", task=task)
sequence.load_task_properties()