mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
control.assign_control to support batching
This commit is contained in:
@@ -138,7 +138,7 @@ def add_task(
|
||||
task.Identification = identification
|
||||
task.IsMilestone = False
|
||||
if work_schedule:
|
||||
ifcopenshell.api.control.assign_control(file, work_schedule, task)
|
||||
ifcopenshell.api.control.assign_control(file, work_schedule, [task])
|
||||
elif parent_task:
|
||||
rel = ifcopenshell.api.nest.assign_object(
|
||||
file,
|
||||
|
||||
@@ -75,7 +75,7 @@ def add_work_calendar(
|
||||
# We associate the calendar with the construction root task. All
|
||||
# subtasks underneath the construction work task will also inherit
|
||||
# this calendar by default (though you can override them).
|
||||
ifcopenshell.api.control.assign_control(model, relating_control=calendar, related_object=task)
|
||||
ifcopenshell.api.control.assign_control(model, relating_control=calendar, related_objects=[task])
|
||||
"""
|
||||
work_calendar = ifcopenshell.api.root.create_entity(
|
||||
file,
|
||||
|
||||
@@ -47,5 +47,5 @@ def copy_work_schedule(
|
||||
duplicated_tasks = ifcopenshell.api.sequence.duplicate_task(file, task)[1]
|
||||
# All other nested items are not connected to the work schedule explicitly.
|
||||
duplicated_task = duplicated_tasks[0]
|
||||
ifcopenshell.api.control.assign_control(file, new_schedule, duplicated_task)
|
||||
ifcopenshell.api.control.assign_control(file, new_schedule, [duplicated_task])
|
||||
return new_schedule
|
||||
|
||||
@@ -79,7 +79,7 @@ class Usecase:
|
||||
assert isinstance(res, list)
|
||||
current, duplicate = res
|
||||
ifcopenshell.api.control.assign_control(
|
||||
self.file, relating_control=baseline_work_schedule, related_object=duplicate[0]
|
||||
self.file, relating_control=baseline_work_schedule, related_objects=[duplicate[0]]
|
||||
)
|
||||
for i, task in enumerate(current):
|
||||
self.create_baseline_reference(task, duplicate[i])
|
||||
|
||||
Reference in New Issue
Block a user