Source and output

Project Files

(Right-click on projects to save)
How to Compile and Run

Create Sample Building With Geometry

The GEOMETRY sample program is an IFC "hello world" program that creates a building that has a simple block shape. While creating the building data, the program also makes a project and owner history, assigns units, and greates IFC unique identifiers (GUIDs). Use this as the starting point for a more sophisticated program.

This program creates the data set and saves it as a STEP Part 21 file called "output_file.ifc". This is a text file, so you can look at it with a text editor or the STEP Part 21 file browser to see how the information is represented.

The make_units.cxx file contains code for creating an IfcUnitAssignment for the file. The sample code creates foot and degree units, but you can easily change it to use meters instead.

The make_history.cxx file contains sample code for creating a IfcOwnerHistory description. You should extend this code as with a description of your own application.

The make_guid.cxx file contains code for creating the base64 encoded 128bit IDs used by most IFC objects. This is implemented using some #ifdefed platform-specific code that calls operating system functions to generate the ID. Because of this, the Windows, MacOS X, and Linux projects each link some platform-specific OS libraries. This is described in more detail in the source code.