ifcopenshell.api.sequence.remove_task#

Module Contents#

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

Removes a task

All subtasks are also removed recursively. Any relationships such as sequences or controls are also removed.

Parameters

task (ifcopenshell.entity_instance.entity_instance) – The IfcTask to remove.

Returns

None

Return type

None

Example:

# Let's imagine we are creating a construction schedule. All tasks
# need to be part of a work schedule.
schedule = ifcopenshell.api.run("sequence.add_work_schedule", model, name="Construction Schedule A")

# Add a root task to represent the design milestones, and major
# project phases.
ifcopenshell.api.run("sequence.add_task", model,
    work_schedule=schedule, name="Milestones", identification="A")
design = ifcopenshell.api.run("sequence.add_task", model,
    work_schedule=schedule, name="Design", identification="B")
ifcopenshell.api.run("sequence.add_task", model,
    work_schedule=schedule, name="Construction", identification="C")

# Ah, let's delete the design section, who needs it anyway we'll
# just fix it on site.
ifcopenshell.api.run("sequence.remove_task", model, task=design)
execute(self)#