Overview

When you create new data, the Part 21 file will normally identify its schema version as IFC4. You can call ifclib_put_schema() with one of the IfclibSchemaType enum values to identify the file as IFC2x3 or a newer IFC4 version. The ifclib_schema_none value is used to indicate a design has just been created and not assigned an schema.

These functions change the schema name written in the header section of the Part 21 file, which is IFC4 by default. The following program creates a design with a few cartesian points, then writes it out using each schema. The links below show the resulting Part 21 files.

#include <ifc_schema.h>

void main()
{
    ifclib_init();

    RoseDesign *d = new RoseDesign (foo);
    RoseObject * obj;

    // Some geometry, common across all APs
    obj = pnewIn(d) IfcCartesianPoint;
    obj = pnewIn(d) IfcCartesianPoint;
    obj = pnewIn(d) IfcCartesianPoint;

    // default, ifc4 schema
    d-> saveAs ("test_default.ifc");

    ifclib_put_schema (d, ifclib_schema_ifc4);
    d-> saveAs ("test_2x4.ifc");

    ifclib_put_schema (d, ifclib_schema_ifc2x3);
    d-> saveAs ("test_2x3.ifc");

    ifclib_put_schema (d, ifclib_schema_ifc2x2);
    d-> saveAs ("test_2x2.ifc");
}

The complete set of types are available to you, so it is possible to create files containing instances that are not appropriate for an file, such as new IFC4 instances in an IFC2x3 file.

The library currently writes older IFC files using the attributes defined in IFC4, which may include data beyond what was in IFC2x3 and cause problems with some applications. As time goes on, we will continue to address these migration issues and improve handling for older IFC data.