Skip to main content

assign_cost_quantities

Function assign_cost_quantities 

Source
pub fn assign_cost_quantities(
    tx: &mut Transaction,
    model: &Model,
    cost_item: EntityId,
    quantities: &[EntityId],
) -> CostAuthoringResult<()>
Expand description

Attach quantities to an existing IfcCostItem, in the model’s declared release.

Replaces CostQuantities wholesale rather than appending: a partial update would leave the caller unable to express removal, and silently accumulating duplicates would double a measured sum.

Every quantity must be an instantiable subtype of the release’s own CostQuantities declaration (IfcPhysicalQuantity), read from its table rather than a fixed list (#203): IFC4X3 adds IfcQuantityNumber, which IFC4 does not declare. The slot is found by name, not assumed.

§Errors

A cost_item that is not an IfcCostItem; an empty or duplicated quantity list; a quantity that is missing (MissingReference) or not a physical quantity of the release (WrongReferenceType, such as an IfcQuantityNumber in IFC4); a header binding no single known release (MultipleSchemas, UnsupportedSchema); and an IFC2X3 model, whose IfcCostItem declares no CostQuantities (AuthoringNotInSchema). Nothing is staged on an error.