IFC4 impl guidance summary
Beside working on the IFC specification development, the buildingSMART Model Support Group also supports the IFC implementation work by providing guidelines, tutorials and examples. In collaboration with software implementers, organized in the buildingSMART Implementation Support Group, MSG also publishes implementation agreements and offers implementation issue resolution.
IFC implementation support material is also provided by others, see www.ifcwiki.org, and particularly the developer page, for more information.
Basic Knowledge
If you are new to IFC implementation it is relevant to read some background and generic information about IFC in Basic IFC knowledge. This basic knowledge is independent of the particular IFC release.
If you are mainly interested in the differences between IFC2x3 and IFC look here.
Helpful tools
Everybody that is implementing IFC needs some kind of parser to retrieve and/or generate IFC content. Developing such parsers keeping performance when files grow in size can take a lot of time, but there are good solutions that away this effort in the form of Toolboxes.
Helpful viewers
To view geometry as well as properties and relations within IFC files it is not needed to use a CAD or other commercial software package. Several vendors have free IFC viewers available
IFC4 compared to IFC2x3
Using IFC2x3 files in an IFC4 implementation environment and vise versa requires particular care. This is discussed here.
Model View Definition
Especially when implementing IFC it is important to understand the concept and restrictions of the Model View Definition you want to support. Model View Definitions for the upcoming IFC4 release are yet to be formalized.
Examples
As with any implementation task, work by example helps understand the work that has to be done and what should be done. The Model Support Group offers examples as well as example code that can be used for this purpose. All source code is free to be used and changed for commercial and non-commercial purposes (the used toolbox is only free in non-commercial projects but also can be exchanged with other toolboxes).
Examples IFC4 Hello Wall example IFC4 Hello House example
Basic IFC knowledge
It is important to know that the actual IFC file, whether it is an SPF (STEP Physical File) or XML representation, is always defined against a schema. The schema gives meaning (names and relations on top of the knowledge contained in the IFC file). The schema is static for all IFC4 files. It is published by buildingSMART as an EXPRESS schema and alternatively an XML schema.
Currently the latest version is the Release Candidate 4 of IFC4. It can be downloaded at:
IFC4 RC4 page
On top of the schema MVDs (Model View Definitions) are defined that describe what parts of the schema are used within a certain IFC file and/or extra restrictions on top of the schema. IFC4 is describing each instance of a building component that is contained in the IFC file.
The instance contains semantic data like its name, description, type (wall vs. door), relations with other instances (connections to walls/other objects, opening elements), position and relation in the building structure as well as geometry and property sets. New to IFC4 is that each instance has also a type defined (in previous versions this was only valid for a subset of the instances). Non geometrical information can be attached to instances as well as to types.
Several instances can refer to the same type. The position of instances is absolute or relative towards the position of another instance, these relative placements can be nested and several levels deep. Geometry of each visible instance is defined. It is however possible to reuse defined geometry from other instances.
Not all defined geometry in an IFC file is visible in CAD or viewers. For example space boundaries between walls and spaces are often defined but mostly not shown. Each instance can have more than 1 geometrical representation and a single 3D representation of an instance can have more than one color.
IFC4 files are full of relations. Many of these relations are inverse relations defined by the schema and not visible in the text view of an IFC file.
Helpful tools
Background information on toolboxes, for a listing see here:
http://buildingsmart-tech.org/implementation/get-started/ifc-toolboxes http://buildingsmart-tech.org/implementation/get-started/ifc-open-source Many companies that implement IFC make use of a toolkit. It can be seen as a database that stores the IFC data and can be accessed to read/write and edit the IFC model. A toolkit does not have to be specifically written for IFC or IFC4. Generic STEP Express toolkits will do the job, note that many STEP Express toolkits will also import/export ifcXML serialization. Toolboxes are also differentiated by the programming languages they support, such as Java, C++, C#, etc.
When starting using a toolbox it is important to know if you want to use late binding or early binding:
Late binding: the toolbox is used as such and the model schema (in this case the IFC4 schema) can be loaded on the fly. In most cases the ISO standard API SDAI is used to enable interaction with the toolbox. Early binding: based on the schema an interface is generated / created. The benefit of this interface is that it knows the schema and during implementation the language helps you with correct implementation by giving only the valid options. Not all toolboxes support both early binding and late binding. Some toolboxes also included code to generate the visualization of each object for certain versions of IFC. Next to the stat-of-the-art professional toolboxes there are also very good quality free toolboxes available. Implementation without a toolbox is possible, especially for export. Building good quality and performing import for large files is time consuming and complex.
Helpful tools(Viewers)
Over the years many IFC Viewers are developed and the number of viewers is still growing. It is expected that most of the tools will also support IFC4 soon.
Currently the following viewer are able to view IFC4 files.
http://www.constructivity.com/
Next to 3D viewers also text based and property viewers are available, many of them are generic in a way to display various IFC releases. In practice most IFC developers use several viewers at the same time.
IFC4 vs. IFC2x3
Models exported/created according to IFC2x3 cannot be guaranteed to open directly as IFC4 and vice versa. This is because IFC4 is not only an extension of IFC2x3 but also contains modified and enriched existing entities and lacks some obsolete and deprecated IFC2x3 entities.
From code point of view (in both early and late binding) it is possible that software packages handling a small subset of IFC2x3 can work without any change on IFC4 files. This is achieved for the subset of the IFC2x3 Coordination View V2.0, it is however not guaranteed outside this scope.
Be aware that even when everything seems to work for IFC4 it can be the result is incomplete as extra relations could be required.
Model View Definition (MVD)
As was the case with all previous releases of IFC only a subset of the IFC4 schema will be relevant for the different situations where IFC4 is used. A Model View Definition defines what subset of the schema and what rules/relations are required. Implementation and certification is always against a MVD.
Currently no MVD for IFC4 are already officially released or registered by buildingSMART International however a number of MVD development projects using IFC4 already on its way:
pre-cast elements product libraries
Examples
There are several examples of IFC4 files that comply to the published release candidates of IFC4 already. Reference to IFC 4 examples are now also part of the official IFC specification:
http://www.buildingsmart-tech.org/ifc/IFC2x4/rc4/html/index.htm (Annex E)
In addition, you find here two examples of IFC4 files
Hello Wall Hello House
Above examples are written in C/C++ and can be opened with Visual Studio 6, VS2005 and converted to all new Visual Studio environments. All source code is free to be used and changed for commercial and non-commercial purposes (the used toolbox is only free in non-commercial projects but also can be exchanged with other toolboxes).
Currently those example files are only available as .ifc files (using P21 file structure), examples for .ifcxml files (using XML file structure) are upcoming.
- IFC4 Hello Wall example
All code within this project is free to be used and changed in both commercial and non-commercial projects. The used IFC Engine DLL requires a fee in commercial environments but can be exchanged with another toolbox.
- IFC Hello House example
All code within this project is free to be used and changed in both commercial and non-commercial projects. The used IFC Engine DLL requires a fee in commercial environments but can be exchanged with another toolbox.