Module Contents#

class ifcopenshell.api.constraint.add_objective.Usecase(file)#

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.


The newly created IfcObjective entity

Return type



# Create a new objective for code compliance requirements
objective = ifcopenshell.api.run("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.