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, related_object)
duplicate_task(task)
execute()
ifcopenshell.api.sequence.duplicate_task.duplicate_task(file: ifcopenshell.file, task: ifcopenshell.entity_instance) 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 (ifcopenshell.entity_instance) – The task to be duplicated

Returns:

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

Return type:

ifcopenshell.entity_instance or list of ifcopenshell.entity_instance

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)