Search STEP Tools Web Support

Source and output

Project Files

(Right-click on projects to save)

Create Wall Properties, Quantities, and Material

The HELLO WALL sample program creates a standard wall and attaches property sets and quantities to it. The program also adds the wall to a simple spatial tree consisting of an IfcProject containing an IfcBuilding with a single IfcBuildingStorey.

This program saves the data set as a STEP Part 21 file called "output_wall.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.

Build Instructions

In the list above, select your Visual Studio version or platform, then right click on the link to save the zipped project files to your local disk. Unpack the zipfile.

On Windows, open the enclosed project file with Visual Studio and compile the program by selecting "Build All". The project creates a Console application that you can run from the command line. When using the 64bit version of ST-Developer, change the platform from "win32" to "X64" in the Visual Studio Configuration Manager before building.

On MacOS, Linux, and other Unix systems, the project directory contains a makefile that builds the sample program. The makefile uses the ROSE, ROSE_INCLUDE, and ROSE_LIB environment variables described in the ST-Developer installation notes. Compile the program by typing "make".

The Windows projects also include a makefile that you can use by typing "nmake", but you must run vcvars32.bat (found in the Visual Studio C++ bin directory) to make sure that the C++ compiler is in the command line search path.

Java Build Instructions

Right click on the link for the Java Version and save the project zipfile to your local disk. Unpack the zipfile.

You can build and run from the command line or with an IDE like Eclipse. In either case, you must add the jars for the base ST-Developer classes and the IFC schema classes to your classpath.

On the command line, you can find these jars through the ROSE environment variable as shown below:

# windows
> javac -cp "%ROSE%\lib\java\stdev.jar;%ROSE%\lib\java\ifc2x3lib.jar" HelloWall.java
> java  -cp "%ROSE%\lib\java\stdev.jar;%ROSE%\lib\java\ifc2x3lib.jar;." HelloWall

# unix
> javac -cp "$ROSE/lib/java/stdev.jar;$ROSE/lib/java/ifc2x3lib.jar" HelloWall.java
> java  -cp "$ROSE/lib/java/stdev.jar;$ROSE/lib/java/ifc2x3lib.jar;." HelloWall

Wit Eclipse, we suggest setting a classpath variable called ROSE_JAVA that points to the ST-Developer jar directory, so you can refer to jars in a portable way.

In the properties dialog under Project | Properties, select Java Build Path and the Libraries tab. Then use Add Variable | Configure Variables | New to create a classpath variable called ROSE_JAVA that points to the ST-Developer jar folder. To reference each jar, select Add Variable, choose ROSE_JAVA and use Extend to pick the stdev.jar or ifc2x3.jar files.