Skip to main content

create_lag_time

Function create_lag_time 

Source
pub fn create_lag_time(
    tx: &mut Transaction,
    name: Option<&str>,
    lag_value: Value,
    duration_type: &str,
) -> ScheduleAuthoringResult<EntityId>
Expand description

Stage an IfcLagTime.

LagValue and DurationType are both REQUIRED by the schema, unlike every other scheduling-time field, so neither is an Option here: a lag that states neither how long nor in what units is not a lag.

lag_value is an IfcTimeOrRatioSelect. A duration is an ISO 8601 string; a ratio is a plain number. The caller picks, because the two mean different things and this crate will not guess.

LagValue is declared IfcTimeOrRatioSelect = SELECT (IfcDuration, IfcRatioMeasure) in IFC4 and IFC4X3, so the value is written as the typed parameter of the member it is (#201): a string as IFCDURATION('P5D'), a number as IFCRATIOMEASURE(0.5) (an integer is written as that REAL). A value already typed as one of those two members is accepted as is.

Takes no model, so it cannot see the model’s release and is for IFC4 and IFC4X3 only. IFC2X3 declares no IfcLagTime: there the lag is IfcRelSequence.TimeLag itself, an IfcTimeMeasure (TimeLag::Seconds). To have the header’s release checked, use create_lag_time_in.