ifcopenshell.util.sequence

Module Contents

ifcopenshell.util.sequence.count_working_days(start, finish, calendar: ifcopenshell.entity_instance) int
ifcopenshell.util.sequence.derive_calendar(task: ifcopenshell.entity_instance) ifcopenshell.entity_instance | None
ifcopenshell.util.sequence.derive_date(task, attribute_name, date=None, is_earliest=False, is_latest=False)
ifcopenshell.util.sequence.get_all_nested_tasks(task: ifcopenshell.entity_instance) Iterator[ifcopenshell.entity_instance]
ifcopenshell.util.sequence.get_calendar(task: ifcopenshell.entity_instance) ifcopenshell.entity_instance | None
ifcopenshell.util.sequence.get_direct_task_outputs(task: ifcopenshell.entity_instance) list[ifcopenshell.entity_instance]
ifcopenshell.util.sequence.get_nested_tasks(task: ifcopenshell.entity_instance) list[ifcopenshell.entity_instance]
ifcopenshell.util.sequence.get_parent_task(task: ifcopenshell.entity_instance) ifcopenshell.entity_instance | None
ifcopenshell.util.sequence.get_recent_working_day(start, duration_type: DURATION_TYPE, calendar: ifcopenshell.entity_instance)

Gets the related products being output by a task

Parameters:
  • relating_product (ifcopenshell.entity_instance, optional) – One of the products already output by the task.

  • related_object (ifcopenshell.entity_instance, optional) – The IfcTask that you want to get all the related products for.

Returns:

A set of IfcProducts output by the IfcTask.

Return type:

set[ifcopenshell.entity_instance]

Example:

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

# Let's create a construction task. Note that the predefined type is
# important to distinguish types of tasks.
task = ifcopenshell.api.sequence.add_task(model,
    work_schedule=schedule, name="Build wall", identification="A", predefined_type="CONSTRUCTION")

# Let's say we have a wall somewhere.
wall = ifcopenshell.api.root.create_entity(model, ifc_class="IfcWall")

# Let's construct that wall!
ifcopenshell.api.sequence.assign_product(relating_product=wall, related_object=task)

# This will give us a set with that wall in it.
products = ifcopenshell.util.sequence.get_related_products(related_object=task)
ifcopenshell.util.sequence.get_root_tasks(work_schedule: ifcopenshell.entity_instance) list[ifcopenshell.entity_instance]
ifcopenshell.util.sequence.get_root_tasks_ids(work_schedule: ifcopenshell.entity_instance) list[int]
ifcopenshell.util.sequence.get_sequence_assignment(task: ifcopenshell.entity_instance, sequence='successor')
ifcopenshell.util.sequence.get_soonest_working_day(start, duration_type: DURATION_TYPE, calendar: ifcopenshell.entity_instance)
ifcopenshell.util.sequence.get_start_or_finish_date(start, duration, duration_type: DURATION_TYPE, calendar: ifcopenshell.entity_instance, date_type: Literal['START', 'FINISH'] = 'FINISH')
ifcopenshell.util.sequence.get_task_inputs(task: ifcopenshell.entity_instance, is_deep: bool = False) list[ifcopenshell.entity_instance]
ifcopenshell.util.sequence.get_task_outputs(task: ifcopenshell.entity_instance, is_deep: bool = False) list[ifcopenshell.entity_instance]
ifcopenshell.util.sequence.get_task_resources(task: ifcopenshell.entity_instance, is_deep: bool = False) list[ifcopenshell.entity_instance]
ifcopenshell.util.sequence.get_task_work_schedule(task: ifcopenshell.entity_instance) ifcopenshell.entity_instance | None
ifcopenshell.util.sequence.get_tasks_for_product(product: ifcopenshell.entity_instance, schedule: ifcopenshell.entity_instance | None = None) tuple[list[ifcopenshell.entity_instance], list[ifcopenshell.entity_instance]]

Get all tasks assigned to or referenced by the given product.

Args:

product: An object that is assigned tasks or references tasks. schedule: An optional string representing the schedule name to filter tasks by.

Returns:

A tuple of two lists: - The first list contains all tasks assigned to the product. - The second list contains all tasks referenced by the product that are part of the given schedule.

ifcopenshell.util.sequence.get_work_schedule_tasks(work_schedule: ifcopenshell.entity_instance) list[ifcopenshell.entity_instance]
ifcopenshell.util.sequence.guess_date_range(work_schedule: ifcopenshell.entity_instance)
ifcopenshell.util.sequence.has_task_inputs(task: ifcopenshell.entity_instance) bool
ifcopenshell.util.sequence.has_task_outputs(task: ifcopenshell.entity_instance) bool
ifcopenshell.util.sequence.is_calendar_applicable(day, calendar: ifcopenshell.entity_instance) bool
ifcopenshell.util.sequence.is_day_in_work_time(day, work_time: ifcopenshell.entity_instance) bool
ifcopenshell.util.sequence.is_work_time_applicable_to_day(work_time: ifcopenshell.entity_instance, day) bool
ifcopenshell.util.sequence.is_working_day(day, calendar: ifcopenshell.entity_instance) bool
ifcopenshell.util.sequence.offset_date(start, duration, duration_type: DURATION_TYPE, calendar: ifcopenshell.entity_instance)
ifcopenshell.util.sequence.DURATION_TYPE
ifcopenshell.util.sequence.RECURRENCE_TYPE