Skip to main content

create_project_with_owner_history

Function create_project_with_owner_history 

Source
pub fn create_project_with_owner_history(
    tx: &mut Transaction,
    model: &Model,
    global_id: &str,
    name: Option<&str>,
    units: Option<EntityId>,
    representation_contexts: &[EntityId],
    owner_history: EntityId,
) -> SpatialAuthoringResult<EntityId>
Expand description

create_project in the model’s declared release, with a caller-supplied IfcOwnerHistory, which IFC2X3 requires.

representation_contexts fills RepresentationContexts, a SET [1:?]: empty leaves it $, which IFC4 and IFC4X3 allow and IFC2X3, which requires it (as it requires UnitsInContext), refuses with AuthoringRequired (#214). Each context must be an IfcRepresentationContext in the model or staged on tx, and not an IfcGeometricRepresentationSubContext, which every release’s IfcProject rule (IFC2X3 WR32, IFC4 and IFC4X3 CorrectContext) forbids.

§Errors

Those of create_project, the release and owner-history refusals of aggregate_with_owner_history, and on RepresentationContexts: a duplicated context (Invalid), one that resolves nowhere (MissingReference), one that is not an IfcRepresentationContext (WrongReferenceType) and a sub-context (Invalid). Nothing is staged on an error.