ifcopenshell.api.constraint.assign_constraint
¶
Module Contents¶
- class ifcopenshell.api.constraint.assign_constraint.Usecase¶
- execute()¶
- get_constraint_rels() list[ifcopenshell.entity_instance] ¶
- ifcopenshell.api.constraint.assign_constraint.assign_constraint(file: ifcopenshell.file, products: list[ifcopenshell.entity_instance], constraint: ifcopenshell.entity_instance) ifcopenshell.entity_instance | None ¶
Assigns a constraint to a list of products
This assigns a relationship between a product and a constraint, so that when a product’s properties and quantities do not match the requirements of the constraint’s metrics, results can be flagged.
It is assumed (but not explicit in the IFC documentation) that constraints are inherited from the type. This way, it is not necessary to create lots of constraint assignments.
- Parameters:
products (list[ifcopenshell.entity_instance]) – The list of products the constraint applies to. This is anything which can have properties or quantities.
constraint (ifcopenshell.entity_instance) – The IfcObjective constraint
- Returns:
The new or updated IfcRelAssociatesConstraint relationship or None if products was an empty list.
- Return type:
ifcopenshell.entity_instance