Skip to main content

create_currency_relationship

Function create_currency_relationship 

Source
pub fn create_currency_relationship(
    tx: &mut Transaction,
    model: &Model,
    relating: EntityId,
    related: EntityId,
    exchange_rate: f64,
    rate_date_time: Option<DateTimeValue<'_>>,
) -> CostAuthoringResult<EntityId>
Expand description

Stage an IfcCurrencyRelationship: an exchange rate between two monetary units, in the model’s declared release.

The rate is an IfcPositiveRatioMeasure, so zero and negative rates are refused: a rate of zero would value every converted cost at nothing, which is a conversion nobody meant to state. rate_date_time is IfcDateTime text in IFC4 and IFC4X3, where it is optional; IFC2X3 requires it as an IfcDateAndTime record (DateTimeValue::DateAndTime), which the writer stages.

§Errors

A reference that is not an IfcMonetaryUnit, a unit related to itself, a non-positive or non-finite rate; a header binding no single verified release; a date the schema’s rules refuse (InvalidValue) or in a form the release does not declare (AuthoringValueType); and in IFC2X3 a missing rate_date_time (AuthoringRequired). Nothing is staged on an error.