ifcopenshell.api.sequence.duplicate_task

Module Contents

class ifcopenshell.api.sequence.duplicate_task.Usecase
copy_indirect_attributes(from_element, to_element)
copy_sequence_relationship(original_tasks, duplicated_tasks)
create_object_reference(relating_object: ifcopenshell.entity_instance, related_object: ifcopenshell.entity_instance) ifcopenshell.entity_instance
duplicate_task(task)
execute()
file: ifcopenshell.file
settings: dict[str, Any]
ifcopenshell.api.sequence.duplicate_task.duplicate_task(file: ifcopenshell.file, task: ifcopenshell.entity_instance) ifcopenshell.entity_instance | list[ifcopenshell.entity_instance]

Duplicates a task in the project

The following relationships are also duplicated:

  • The copy will have the same attributes and property sets as the original task

  • The copy will be assigned to the parent task or work schedule

  • The copy will have duplicated nested tasks

Parameters:

task – The task to be duplicated

Returns:

The duplicated task or the list of duplicated tasks if the latter has children

Example: .. code:: python

# We have a task original_task = Task(name=”Design new feature”, deadline=”2023-03-01”)

# And now we have two duplicated_task = project.duplicate_task(original_task)