ifcopenshell.api.structural.assign_product

Module Contents

ifcopenshell.api.structural.assign_product.assign_product(file: ifcopenshell.file, relating_product: ifcopenshell.entity_instance, related_object: ifcopenshell.entity_instance) ifcopenshell.entity_instance

Links an object to a product via IfcRelAssignsToProduct

Typically used to associate a physical building element with a structural analysis member (IfcStructuralSurfaceMember, IfcStructuralCurveMember) so that analysis results can be traced back to the physical model.

Parameters:
  • relating_product – The IfcProduct that the object is assigned to, typically an IfcStructuralMember.

  • related_object – The IfcObjectDefinition being assigned, typically a physical building element such as an IfcWall or IfcSlab.

Returns:

The IfcRelAssignsToProduct relationship.

Example:

wall = ifcopenshell.api.root.create_entity(model, ifc_class="IfcWall")
member = ifcopenshell.api.root.create_entity(
    model, ifc_class="IfcStructuralSurfaceMember")
ifcopenshell.api.structural.assign_product(model,
    relating_product=member, related_object=wall)