ifcopenshell.api.unit.add_monetary_unit

Module Contents

ifcopenshell.api.unit.add_monetary_unit.add_monetary_unit(file: ifcopenshell.file, currency: str = 'DOLLARYDOO') ifcopenshell.entity_instance

Add a new currency

Currency units are useful in cost plans to know in what currency the costs are calculated in. The currencies should follow ISO 4217, like USD, GBP, AUD, MYR, etc.

Parameters:

currency (str) – The currency code

Returns:

The newly created IfcMonetaryUnit

Return type:

ifcopenshell.entity_instance

Example:

# If you do all your cost plans in Zimbabwean dollars then nobody
# knows how accurate the numbers are.
zwl = ifcopenshell.api.unit.add_monetary_unit(model, currency="ZWL")

# Make it our default currency
ifcopenshell.api.unit.assign_unit(model, units=[zwl])