ifcopenshell.api.sequence.duplicate_task#

Module Contents#

class ifcopenshell.api.sequence.duplicate_task.Usecase(file, task=None)#

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.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.entity_instance or list of ifcopenshell.entity_instance.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)

copy_indirect_attributes(self, from_element, to_element)#
copy_sequence_relationship(self, original_tasks, duplicated_tasks)#
create_object_reference(self, relating_object, related_object)#
duplicate_task(self, task)#
execute(self)#