control.assign_control to support batching

This commit is contained in:
Andrej730
2025-09-09 11:14:57 +05:00
parent fcb263f59a
commit abfb56350d
23 changed files with 104 additions and 50 deletions
+4 -6
View File
@@ -135,10 +135,8 @@ def assign_cost_item_type(
List of found product types.
"""
product_types = list(spatial.get_selected_product_types())
rels = [
ifc.run("control.assign_control", relating_control=cost_item, related_object=product_type)
for product_type in product_types
]
ifc.run("control.assign_control", relating_control=cost_item, related_objects=product_types)
cost.load_cost_item_types(cost_item)
return product_types
@@ -213,10 +211,10 @@ def assign_cost_value(
ifc.run("cost.assign_cost_value", cost_item=cost_item, cost_rate=cost_rate)
existing_cost_rate = cost.get_assigned_rate_cost_item(cost_item)
if existing_cost_rate is None:
ifc.run("control.assign_control", relating_control=cost_rate, related_object=cost_item)
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.assign_control", relating_control=cost_rate, related_object=cost_item)
ifc.run("control.assign_control", relating_control=cost_rate, related_objects=[cost_item])
def load_schedule_of_rates(cost: type[tool.Cost], schedule_of_rates: ifcopenshell.entity_instance) -> None:
+1 -1
View File
@@ -422,7 +422,7 @@ def edit_task_calendar(
task: ifcopenshell.entity_instance,
work_calendar: ifcopenshell.entity_instance,
) -> None:
ifc.run("control.assign_control", relating_control=work_calendar, related_object=task)
ifc.run("control.assign_control", relating_control=work_calendar, related_objects=[task])
ifc.run("sequence.cascade_schedule", task=task)
sequence.load_task_properties()