Skip to content

ifc-cost ​

Cost semantics as a borrowed view over the IFC model.

StatusImplemented
Latest release0.3.0 (2026-09-29)
Registriescrates.io ifc-cost
Via the facadeopenbim-ifc feature cost
API documentationrustdoc · docs.rs
Sourcecrates/ifc-cost/

Overview ​

ifc-cost — cost semantics as a view over the model.

Depends on ​

Changes ​

Latest release, 0.3.0 (2026-09-29):

Added ​

  • IFC2X3 cost schedules can carry their dates (#214): DateTimeValue carries a date either as IFC4/IFC4X3 IfcDateTime text (DateTimeValue::Text, From<&str>) or as one of the IFC2X3 IfcDateTimeSelect records (Date(CalendarDate), Time(LocalTime), DateAndTime(CalendarDate, LocalTime)). In IFC2X3 create_cost_schedule_with_owner_history stages the IfcCalendarDate, IfcLocalTime and IfcDateAndTime records for SubmittedOn and UpdateDate and references them, only once the schedule itself is accepted. Record forms are checked against the schema's rules before anything is staged (IfcValidCalendarDate with IfcLeapYear, IfcValidTime, and the component ranges), refused with InvalidValue. The types duplicate ifc-schedule's, since sibling domain crates may not depend on each other.
  • Every draft has a constructor and a setter per optional field, named after it: CostItemDraft::new(global_id), CostScheduleDraft::new(global_id), NestingDraft::new(global_id, parent, children), ScheduleAssignmentDraft::new(global_id, schedule, items), QuantityDraft::new(kind, name, value); CostValueDraft keeps monetary and Default and gains setters.

Fixed ​

  • create_cost_schedule_with_owner_history no longer refuses every dated IFC2X3 schedule (#214): a record form is written as the IfcDateTimeSelect IFC2X3 declares. In IFC4 and IFC4X3 a record form is refused with AuthoringValueType, as text is in IFC2X3.

Changed (breaking) ​

  • create_cost_value, create_monetary_unit and create_currency_relationship bind the model's declared release and lay their records out by attribute name (#213). They wrote the IFC4 layout into every model. In IFC2X3 an IfcCostValue has eight attributes and requires CostType, written from category (IFC4 renamed CostType to Category); a composed value (ArithmeticOperator, Components) is refused with AuthoringNotInSchema. IfcMonetaryUnit.Currency is an IfcCurrencyEnum enumerator in IFC2X3 (a label it does not list is AuthoringValueType) and an IfcLabel from IFC4 on. An IFC2X3 IfcCurrencyRelationship has five attributes and requires RateDateTime as an IfcDateAndTime record. IFC4 and IFC4X3 records are unchanged.
  • create_monetary_unit takes the &Model (create_monetary_unit(tx, model, currency)), which it needs to bind the release.
  • CostValueDraft::applicable_date and fixed_until_date are Option<DateTimeValue>, and create_currency_relationship takes rate_date_time: Option<DateTimeValue>: IFC4 and IFC4X3 text as before ("2026-01-01".into(); the draft setters take impl Into<DateTimeValue>), or an IFC2X3 record form, which the writer stages. A form the release does not declare is refused with AuthoringValueType.
  • CostView::schedules returns Result<impl Iterator<Item = CostSchedule>, CostError> and every CostSchedule accessor reads its attribute by name in the model's declared release (#212). The IFC4 positions misread an IFC2X3 IfcCostSchedule: PreparedBy as the predefined type, the SubmittedOn record as the status and SubmittedBy as the identification. identification reads IFC2X3's ID, which IFC4 renamed. A header declaring IFC4X1, IFC4X2 or an unknown release is CostError::UnsupportedSchema, several CostError::MultipleSchemas (new variants); no header reads as IFC4.
  • CostSchedule::submitted_on and update_date return Option<AuthoredDateTime>: IFC4/IFC4X3 text or the IFC2X3 date record (AuthoredDateTime::Record), never None for a stated IFC2X3 date.
  • CostSchedule::new(id, entity, release) takes the release to read against and returns Result, refusing IFC4X1 and IFC4X2.
  • CostValueDraft, CostItemDraft, CostScheduleDraft, NestingDraft, ScheduleAssignmentDraft and QuantityDraft are #[non_exhaustive]: build them with their constructors and setters instead of a struct literal. Their fields stay public to read and assign.
  • CostScheduleDraft::submitted_on and update_date are Option<DateTimeValue<'a>> (were Option<&'a str>); text converts with .into() or through the setters, and IFC4/IFC4X3 output is unchanged.
  • #[non_exhaustive] on the public enums and result structs a later release could extend: CostItemType, CostScheduleType, CostValueKind, QuantityKind, ArithmeticOperator, UnitBasis and Consistency. A match outside the crate needs a wildcard arm, and the structs can no longer be built outside it.

Changed ​

  • Depends on ifc-schema with its default features named explicitly (every bundled release), now that the workspace dependency turns them off for the facade's per-release features (#112).
  • A model whose header declares IFC4X1 or IFC4X2 is refused with the existing unsupported-schema error. ifc-schema now bundles both releases, but no layout here is verified against them, so they are never read as IFC4 or IFC4X3.

Full history: crates/ifc-cost/CHANGELOG.md

Released under the AGPL-3.0-or-later licence. ISO and CEN standards material is not redistributed.