Getting started with programming for IFC has never been easier or cheaper.
I present here a stack of great tools that together allow you to build tools that can read, write, analyse, automate, store in a database, and do whatever you want with IFC data. The sky really is the limit. They are all:
- Open source
- Zero cost
- Can be used in commercial and business environments
- Cross platform
- Don’t require elevated admin rights to install or run
The tools are:
- Version control: GIT
- Code editor: Visual Studio Code
- Framework: .NET Core 2.2
- Language: C#
- IFC writing / reading toolkit: xBIM
- Bundler: dotnetwarp
(Note: this is not a detailed, from scratch guide, there may be some degree of additional setup and configuration required depending on your exact system)
I highly recommend against creating your own IFC reader and writer unless you really need to, it is not a task for the faint hearted and you’ll need to absolutely sure that none of the existing solutions fit your requirements.
GIT provides the source code version control system. This tracks all changes and eventually allows you to upload to private and public code repositories, such as GitHub.
You can download and install the latest version from here: https://git-scm.com/
Visual Studio Code
Your Integrated Development Environment is really important, this is where you’ll spend the majority of your time coding and debugging the tools you write.
The Professional and Enterprise versions of the traditional Visual Studio tools are very expensive, hardcore tools, mainly aimed at full time software developers.
A faster and cheaper approach is to use Visual Studio Code. This is a really popular, lightweight Integrated Development Environment that you can install here: https://code.visualstudio.com/
If you use C# with Visual Studio Code, you should also install the C# tools extension from within Visual Studio Code.
.NET Core 2.2
This is Microsoft’s completely open source and free application framework. It contains all the tools needed to develop cross platform libraries, console apps, clouds app, and more.
It doesn’t contain full user interfaces like Winforms or WPF, but my suggested route if you require a UI is to build a command line app for the IFC logic and wrap it with a UI from another technology, such as Electron.
At the time of writing, the latest xBIM library only supports up to NET Core 2.2 so don’t install a version any higher than that. When you’re reading this, check yourself what the highest version xBIM supports.
To install without needing elevated admin rights use the Powershell script here: https://dotnet.microsoft.com/download/dotnet-core/scripts
C# is an open source and open spec language from Microsoft. It is hugely popular with literally millions of users and a vast ecosystem.
It installs with .NET Core listed above, and there are good beginners tutorials here: https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/intro-to-csharp/
This is a software library that takes away the difficult parts of reading and writing IFC files and allows you to focus on the business logic you need to implement.
It’s developed by Northumbria University and has contributions from many other people around the world.
See the Github page for installation instructions: https://github.com/xBimTeam
By default, a .NET Core app (with 2.2) will create a .exe and a large number of DLLs and linked libraries. This makes deployment of general desktop apps quite messy.
To get around this, you can use the dotnetwarp tools which bundles eveything into a single exe file for easy deployment and management.
Nuget installation: https://www.nuget.org/packages/dotnet-warp/
If C# and .NET is a bit too heavy then you can swap them for Python and swap xBIM for IfcOpenShell.
If they aren’t heavy enough, IfcOpenShell is also compatible with C++.
I hope this article is useful for people looking to do development and automation with IFC.
And if you’re already developing with IFC, please comment below to let me know what your stack looks like! What language, IDE, and IFC toolkits do you use?