Skip to main content

stated_unit

Function stated_unit 

Source
pub fn stated_unit(model: &Model, quantity: &Quantity) -> Option<UnitKind>
Expand description

Resolve the unit kind for a quantity, following its explicit unit only.

An Quantity::Unresolved quantity still states its unit, so it has one here even though it has no value. An IFC4X3 IfcQuantityNumber may state any IfcNamedUnit (it has no WR21); it is returned as stated, and a number that states none has none.

Project-default units are NOT applied here: falling back to the project context would report a unit the quantity never stated. Callers that want the effective unit combine this with crate::unit::project_units.