ifcopenshell.api.constraint.add_objective

Module Contents

ifcopenshell.api.constraint.add_objective.add_objective(file: ifcopenshell.file) ifcopenshell.entity_instance

Add a new objective constraint

Parametric constraints may be defined by the user. The constraint is defined by first creating an objective describing the purpose of the constraint and whether it is a hard or soft constraint. Later on, metrics may be added to check whether the constraint has been met by connecting it to properties and quantities. See ifcopenshell.api.constraint.add_metric for more information.

Returns:

The newly created IfcObjective entity

Return type:

ifcopenshell.entity_instance

Example:

# Create a new objective for code compliance requirements
objective = ifcopenshell.api.constraint.add_objective(model)
objective.ConstraintGrade = "ADVISORY"
objective.ObjectiveQualifier = "CODECOMPLIANCE"
# Note: the objective right now is purely qualitative and for
# information purposes. You may wish to add quantiative metrics.