ifcopenshell.api.constraint.add_metric#

Module Contents#

class ifcopenshell.api.constraint.add_metric.Usecase(file, objective=None)#

Add a new metric benchmark

Qualitative constraints may have a series of quantitative benchmarks linked to it known as metrics. Metrics may be parametrically linked to computed model properties or quantities. Metrics need to be satisfied to meet the objective of the constraint.

Parameters

objective (ifcopenshell.entity_instance.entity_instance) – The IfcObjective that this metric is a benchmark of.

Returns

The newly created IfcMetric entity

Return type

ifcopenshell.entity_instance.entity_instance

Example:

objective = ifcopenshell.api.run("constraint.add_objective", model)
metric = ifcopenshell.api.run("constraint.add_metric", model,
    objective=objective)
execute(self)#