ifcopenshell.api.constraint.add_metric

Module Contents

ifcopenshell.api.constraint.add_metric.add_metric(file, objective=None) 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) – The IfcObjective that this metric is a benchmark of.

Returns:

The newly created IfcMetric entity

Return type:

ifcopenshell.entity_instance

Example:

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