ifcopenshell.api.sequence.get_related_products
#
Module Contents#
- class ifcopenshell.api.sequence.get_related_products.Usecase(file, relating_product=None, related_object=None)#
Gets the related products being output by a task
This API function will be removed in the future and migrated to a utility module.
- Parameters
relating_product (ifcopenshell.entity_instance.entity_instance) – One of the products already output by the task.
related_object (ifcopenshell.entity_instance.entity_instance) – The IfcTask that you want to get all the related products for.
- Returns
A set of IfcProducts output by the IfcTask.
- Return type
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") # Let's create a construction task. Note that the predefined type is # important to distinguish types of tasks. task = ifcopenshell.api.run("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.run("root.create_entity", model, ifc_class="IfcWall") # Let's construct that wall! ifcopenshell.api.run("sequence.assign_product", relating_product=wall, related_object=task) # This will give us a set with that wall in it. products = ifcopenshell.api.run("sequence.get_related_products", model, related_object=task)
- execute(self)#