IFC certification + How to Save to IFC file [C#/.NET]? (Pipelines - Sewage/Drainage/Water Supply etc).

Dear IFC developers, dear buildingsmart and to whom it may concern.

I am a C# | .NET programmer for 3d | cad program for Pipelines (Sewage | Drainage | Water Supply) etc. We have own 3d | cad | graphics format, but out program cannot save to other file formats, and also cannot get information from filetypes which are not developed by us.
So, as there is growing demand for interoperability, and users of our program want to be able to save | export Pipelines etc to IFC (and probably to open it later in Civil3d) - I am asked to make export module - to save to IFC.
We 've got some data similar to databases | tables with variables and their content, and that is to be saved to IFC.
I started to learn what is IFC. So I found out that it is developed by buildingSMART (formerly the International Alliance for Interoperability, IAI). So I found your website, and started to make kind of research. We need to make a program | module | library in C# programming language, and it should be able to save our file format - to ifc (mostly and first of all, as beginning we want to be able to export pipelines to Civil3d).
I started to google for C# code for IFC, there are some libraries in NuGet in Visual Studio. And on your site of buildingsmart I found a list of over 400 programs to work with IFC. But first with them is that most of them seems to be closed-source. Even though IFC is said to be open itself, free inter-exchange format between different cad | 3d | vector graphics programs, still it looks like each program which works with IFC supports its features not as good as it is expected. I tried to make IFC files from some cad programs, and found out that generated IFC files are not clear, not intuitively understood. So, my efforts to write a little program to just save a simple pipe (like that in ArchiCad - I took its coordinates - ifcCartesianPoints and ifcPolyLoops) - to IFC is at present unsuccessful.

I faced a problem that there are so many different fields in IFC file. Even to generate simple empty file - something like “HelloIFC” (similar to “Hello, world” program in programming languages world) - came out to be uneasy task. It seems that cad | vector | 3d programs which generate IFC files are putting there some information which seems to be not critical for important core data like coordinates and lines. On other hand, some data for unclear reasons is enciphered | encoded in some way so that I cannot find out how it is at all saved into IFC. Maybe such 3d | vector programs are not even compatible fully with IFC to save even simple 2d-lines etc to IFC files.
So I am having a question about what is IFC-certification? Do we require to pass special IFC-certification program? Do we require some special certificate to be sure that our program is doing what is required by users…? So, what do I need to do to get IFC certificate? Should I learn, study on special IFC courses which are there inside buildingSMART? Do you have in buildingSMART any courses, any lessons - especially for programmers, to be able to develop software in any language (we need now just C#), and make it faster, and without head-aches struggling hard to find out what means what in those lines inside IFC?

I think that ideally there is expected to be some official tool from buildingSMART itself, open-source, written in c# or | and in other most popular programming languages, well-documented, and also with examples, compiled code, maybe some github - freely downloadable repository for everyone who wants to use this free IFC file format - to be able to make it as fast as possible.
But unfortunately, as I can see, even within those over 400 programs | tools | sites to which buildingSMART gives links to - there seems to be only very few tools with open-source code. And even if there are such tools, they seem to be not complete, not full, not possible to compile them and having other problems, making it hard or even impossible to use such repositories present on buildingSMART’s over 400 links list…

This is sad, and forced me to think to write to you.

So, in short, minimum demanded IFC features which we require most of all - is ability to generate some empty blank ifc-file (with those maybe around 100 or so lines with some settings etc), and then also to be able to write data - like Pipelines (Sewage | Drainage | Water Supply).
This is very strange that IFC file cannot be opened or viewed | imported into viewer | editor, if it doesn’t has those extra information. If minimum set of data is cartesian points and lines which connect these points together, then what is the need of all those other properties | variables in the ifc file? it seems like most of those other properties are not used much, but it is strange that they are required, demanded by some cad | 3d | vector programs. It is like adding some extra information to make more encrypted, encoded etc - to be protected against someone. But if this file format is free, then why use encoded parts of text in ifc file?

Please, kindly guide us to make first steps to be able to record, save, export to simplest ifc files with pipes. where to find any manuals for programmers to be able to do such ifc exporter | importer, reader | writer etc?
If we try to make | open big file with size of 1Megabyte or more - there are thousands of lines, and we probably need some tool which is already written in c# to make this exporting to ifc possible, at least export to IFC we need.

Maybe if such source code is not available for free - then we can offer to buy it. Just tell us what options we do have to buy source code in c# to export pipelines or maybe any other objects. We need some reliable tool to test | verify | check generated IFC files to be sure that they are properly created and I believe such checkers can be best done, made by buildingSMART itself… Is buildingSMART a group of companies who develop IFC, and at same time such companies are making commercial tools for vector | 3d | cad graphics, and is it thus so that for this very reason, even tools for this ifc format are not freely available (especially in open-source)?

We have to ask you, buildingSMART, to let us know if there are special parts of your website which are protected only for registered users, who are probably members of buildingSMART, and who thus can access special protected parts of site like documentation for programmers etc? Also, if we speak about IFC standard itself, I want to know what is IFC ISO document which is also sold (there is link on | from you site buildingSMART) on your site? is it different from the files which are at present freely available on your website even for anonymous users | guests?
We found some example to make a wall in IFC, but even link to file from this document - on buildingsmart tech site - is not opening - it says that such file don’t exist. Does it mean that it doesn’t exist only for those who are not registered? Or it is permanently removed? So we need something like this pdf for a wall, but for Pipelines (Sewage | Drainage | Water Supply) etc. And I have no idea how to begin with, from what to make even small file with a simplest smallest pipe, and be able to generate such IFC file properly, so it is opened well in any 3d | vector | graphics programs which is supporting ifc files…
Well, ideally we want to be able to export any other kinds of object to ifc - roads, wells, building etc. and to read them from ifc and to be used inside our “isolated” program which uses own file format.

For example, to make it simple, what is required to make our program 100% certified by buildingSMART but to be able only only to work well and perfectly best only with Pipelines (Sewage | Drainage | Water Supply) - for exporting | saving into IFC files only (not even reading IFCs, and not even working with any other objects in ifc)…?
Is it possible to pass some special “buildingSMART Pipelines Sewage | Drainage | Water Supply export to ifc (course | manual for c# programmer) certification”?
Such module to save from our program to ifc these pipelines is very much necessary and required by our users of program we make, so we are even ready to buy such modules | libraries | source code, certification | certificate | manual etc - whatever - to make it done.
So we need a program that in it we have one more option - to save also to IFC. to save info about our project etc (we need to know how to do it, at least manual from “first hands” - from you), save info about pipelines etc etc.
Please answer us, this email, and provide some best solution, or maybe possible solutions how to achieve this as fast as possible. Internet is huge, and there are so many sites which provide some information or even programs for IFC. But it takes so much time to check them all. Maybe of them are available only if bought, - no free or trial versions etc. so we don’t even know which one
pipelines to ifc exporter" to buy (c# source code) - we don’t know which is better, which has more features, more certified etc - more supporting all newest fields, newest IFC versions etc…

We need kind of description of ifc - especially for programmers in c#, and especially for pipelines, exporting. we need manual with details, examples, best - with available source code, compiled as well, maybe at least DLL-s, but so at least we are able to have full access to all fields, properties etc within ifc file, and not to “invent wheel” making own tool (also not having documentation it seems" mission impossible" right now - trying to guess “blindly” by empirical method of “scientific experiments” - “let’s try in analogical way - maybe it will work and our generated file will be opened without problems”)…

so taking all these into account we kindly ask you to provide us, give us guidelines, hint, answers what to do in such situation and which step are to be performed to achieve this required functionality. - at least to save | export Pipelines (Sewage | Drainage | Water Supply) to ifc in C#.

Ideally I’ld also be happy to get some “minimal ifc file” - having minimum extra fields (which seem to be optional) - so we concentrate on important data within file, and not waste efforts, time, health etc, other resources - on researching the meaning of some optional fields which seem to be a lot of them in ifc file format specification.
it is very bad then when such I’ld say optional information is not added into ifc - it is unable to be opened.
There are so many extra fields which seemed to be just empty, not filled, and it also takes too much useless time, waste of time to research each of them, everyone of them - but in the end to come to the point that they are optional and not “a must” to be included in our save-to-ifc program. Please give us guidelines to make just minimal files first. Having hundreds of lines in ifc file is a bit scary, having thousands of lines in ifc file with some simple 3d object - is tiresome to read it all manually and try to parse, and writing code for each and every “ifc…” property | entity etc…
C# is ideally wanted language for us, but if unfortunately maybe it is not possible, but there is documentation, source-code for similar tool to export pipeline etc to ifc - then also please let us know.

Thank you all in advance. ifc is a good format - to be able to exchange data between different programs, different file types. but maybe because so many companies apply efforts to support it, - then it grows enormously - to add features of hundreds of companies - and make it all possible in IFC… this makes this format too huge, with so much duplicate (probably properties, fields, entities, - at least it seems like that), so it becomes a huge challenge to add ifc support to existing vector graphics program…

I made myself small tool to read ifc file - just cartesian points and loop poly lines - and i can see in Unity3d how 3d model is built only using this minimalistic information. maybe some micro-ifc format is to be introduced to have there only minimalistic information without any extra duplicate fields which just spoil experience of reading ifc file by human. it is very hard to debug ifc files, as their editors and even viewers are usually big programs which run slow.
so we need fast and reliable solution to this demand on ifc-export in our PipeLines etc editor.

Please answer questions above.

Thank you all in advance
Wish you all Merry Christmas and all the best in New Year 2023

IFC models requires significant amount technical work.
Even format looks simple and clear to parse and write, it will require a lot of efforts when you start from scratch.
You should use existing SDK/Toolkits. It will save a lot of work and answer many questions.
There are wide range free and commercial solutions for many platforms
For C# you can look into C# IFC engine or xbim

@IvanD you can find more info about IFC Development Tools in the following database:

They range from commercial to open-source solutions with variety of prices, terms, and support options.

Igor.Sokolov, thank you for answer. Yes, it may look easier to read coordinates from .ifc file by own tool (I’m doing this to visualize coordinates - ifcCartesianPoint and ifcPolyLoop), but if I try to make own ifc file - that’s very hard.
So I downloaded from buildingSmart-repository from github a project to work with ifc files. it is fortunately also in C#. But it uses compiled DLL - GeometryGym, and inside it there are a lot of data which is hard to parse. Saving database to JSON generates too big file with duplicates. Much beter when I use project from oggicial GeometryGym hithub project to save to ifcXML - thus structure looks indeed simple and clear. But when I try saving in this way even simple 4 lines as rectangle -
problem is that it cannot open in important programs like Civil3d or BimVision. It shows blank. Though I use code which is given by GeometryGym - that’s library used by BuildingSmart itself. So this is quite sad. I mean to say that it means that many IFC-viewers/editors cannot open even examples from BuildingSmart (GeomtryGym)… On other hand, FreeCAD and Blender (with ifc plugin) do open IFC-files, which are the generated by GeometryGym/BuildingSmart library freely available from github.

I wonder that there is no programmer’s manual for this Open file format - IFC. On other sites, usually documentation goes with a lot of code for each and every function which is in file format. Say, for ifcCartesianPoint, for ifcPolyLoop etc there should be (I expect) many examples, downloadable from buildingSmart github. But I see only very few folders, and short files which generate quite very simple geometry… Worst part of this is that IFC files cannot open in all IFC-viewers. So thus it gives me doubt that Civil3d (AutoDesk) and BimVision are supporting IFC to 100%, and thus not IFC-certified. This is rather strange for AutoCad/AutoDesk. If this is such a big company to produce CAD software, why they do not make good IFC reader? It looks like their Revit also uses C# code for IFC (also in xBIM mentioned by jwouellette _ I’ll take a look at it - it is too much code and files, and also bugs - not immediately ready to compile - errors to be fixed etc)…

Which IFC viewer is most reliable, and 100% IFC files certified? Is there any such free viewer? I want to know in which IFC viewer I ideally should view my generated IFC files. Because I don’t even know if that’s my own mistakes that IFC files generated by GeometryGym are not opening in Civil3d / BimVision etc. If generated file is not viewable in some programs, but viewable in some others - this makes a feeling that maybe I’m doing something worng. but maybe it also is the problem with IFC-viewers which I use. I don’t know, and whom to ask?

I don’t find a good documentation for ifc Programming anywhere. Only some small parts of code somewhere availabe on internet. I can understand that maybe because format is open and thus in some sense free (as it is avialbale at buildingSmart@github and also at GeometryGym@github for free to download)… But this is very bad, that this very problem exists - so many companies in world have to make serious drawings in CAD software etc, and if they don’t echange data easily and fast - whole process becomes slower, and people are unhappy (and thus many economical problems for many CAD-related industries, also from lack of IFC programmer’s documentation)…

I was trying to analize structure of IFC file. It looks like it has just small header - ISO…, with some simple data in header (automatically filled by GeometryGym), and mosst important - in DATA section are code with “#id = IFC(…)” lines. Problem is that when I even tried to make a code for simple pipe, - I opened IFC file from Civil3d, it had maybe few hundred lines, so for each “IFC…()” line I tried to make new ifcEntity etc in Visual Studio, and it is a problem to find out how to generate those ifcEntities in code, what should I pass to them in brackets, in which order. What is optional and what is critically important as minimum to make it all work and load generated IFC without errors… Say, I tried to take GeometryGym.BuildingSmart example from github and add there a pipe with “ifc pipe segment” property (similarly to example from github - for Road segment) - and it was saved from database.writeFile(“out.ifc”) - but it was unable to be opened even inside Freecad which worked for other simpler ifc entities… So problem is lack of documentation, and I don’t have any desie to ïnvent a wheel" by guessing a lot of time and days how should I write this or that ifc function - by the use of experiments “maybe it will compile, I don’t know”… Without good examples - hard to do anything. If they are not provided from BuildingSmart@github - then where to look for them?

Alternative packages - xBim etc - I may try. I’ve faound probably 4 in the list of around 400 programs in the link given by jwouellette - and of course it will require time for me to try even to compile downloaded versions. Say, I had sometimes to reduce version of GeometryGym to older to make examples from github compile. Or should make them newer, For example to make IfcXML (which looks very nice - small but in hierarchy), - I had required to use Geometry Gym Core version, and not older .NET framework version (before GeometryGym Core).

I wonder where should I add elements in the heirarchical tree - where to add say even a line?
I want just for example to draw a simple line into IFC file, which will have as minimum extra fields as posible - maybe just coordinates - ifcCartesianPoint pt1, and ifcCartesianPoint pt2, and ifcPolyLoop loop1(pt1, pt2), and maybe color in which this line is draw… but even example from geometryGym offers to use larger code.

For example, in old good WinForms I click on panel two times with mouse, and want to save generated points into IFC file, and draw line between them. This even makes it a struggle to make it openable in all possible IFC-viewers. Why even very respected company like Civil3d/Autodesk cannot open generated example by GeometryGym/BuildingSmart (from Github)? I of course think maybe I did something wrong, but … if official example from BuildingSmart/GeoGym can’t open in respected companie’s CAD software (AutoCAD and so on) - then I don’t even know what to think.

Is that library - GeometryGym (offered by BuildingSmart on their Github for IFC) - best for IFC? Or it is just and example, which GeometryGym just provided because of their special friendship with BuildingSmart - to IFC developer…? Yes, I see that GeometryGym itself have commercial plugins/code. DLL is compiled to open and save IFC files. I just wonder, does it mean that to get documentation on how to use DLL from GeometryGym - should I buy something from GeomtryGym? I don’t even see provided documentation or option to buy such API/Programmers Interface docs in C# for IFC of GeoGym site…
About others - also I don’t know. Those several C# libraries avaialble in list of over 400 programs/tools (link of jwouellette) - is it similar problem there? I think I tried to use xBIM in Visual studio, compiled and runned some WInforms/WPF app (asp net version didn’t compile), and it could open IFC file to show as picture. But data is not avaialbe to be easily parsed etc (it is just like picture in raster format, not editable etc by code, I think)…

So this is thus hard to say that IFC is such a “free and open” file format… It is rather strange, or sad (maybe noone pays to BuildingSmart to develop free documentation for programmers of IFC?)

I am puzzled on what to do next. If I’ll use instead of GeoGym (offered by BuldingSmart on github) other libraries like in list of those over 400 tools - I think I have then even less support.

Maybe GeomtryGym is best if it is used as DLL in project of BuildingSmart @github? but if it is best, why generated IFC files are not openable by AutoCad software and other ifc-viewers? some others do open. I don’t know why some programs do open, others don’t. It looks likethose who open official examples from GeoGym - are better. Why BuildingSmart chose exactly GeoGym and say not xBim etc to place it on their BuildingSmart@Github?

I decided to start with GeoGym as it is on BuildingSmart@Github. But to make even simple rectangle requires code like this: (see ConsoleCreateSurfaceMember.cs in GeoGym at github)

but when compiled (library og GeoGym Core is last for today), - it can’t open in BimVision, Civul3d etc. FreeCad can open, Blender also can open. And this is strange. Is generated file is wrong or right? I don’t even know. Whom to ask? Who can answer with 100% confidence?

Why for drawing a rectangle, I need to have also these:
DatabaseIfc, IfcBuilding, IfcProject, IfcPlane? DatabaseIfc is strange thing which is not in IFC file standard, but it there in GeoGym. ifcBuilding is there and ifcProject, but to pass a db into constructor is somewhat strange (if that’s pointer like in C++ it is different). These duplicates of coordinates and axis rotations are somewhat boring unnecessary information. Other generated firelds like SI units - meters, radians etc - who really needs it?
I think ideally IFC file should have a list of coordinates of points, and which figurees are build using those points, with extra attributes for more complicated objects. But simple small project already seem to generate unclear ifc file structure/hyerarchy (if you see IfcContext.JSON - you’ll how big it is even for small geometry data)…
IfcContext if it is similar to ifcProject, why it is added?
I see the ifcSite information - why add it? It is just optional I think.
Then if all goes in hyerarchy in ifcBuilding - still not all drawing are about buildings… So, why then IFCBUILDINGELEMENTPROXY is used to make custom objects?

My conclusion for current day is that different companies are trying to solve their CAD drawing problems relating to IFC - by making own custom objects, own IFC file structure and maybe even own IFC libraries, and thus they are not compatible. I think IFC file format is too much comlicated with unnecessary strictlness, hierarchy and required fields which are making popular programs like those from AutoDesk even not being able to read IFC files.

I see, IFC format is in development… But if so, then still there must be some minimum core documentation, libraries and API for programmers, with exmples, ready for compilation etc - so that they don’t “invent wheels” by geissing what to do and how in IFC files…

So now I am in strange mood, wondering why IFC format is like “anarchy” - everyone does its support in its own way. But thus it leads to conclusion that this ideal which CAD-related companies want - is not achieved by BuildingSmart/IFC at present. No documentation, no examples, no support, no source code, no libraries. “If you sink - then you are the only one who can save yourself in the ocean”. Situation seems like this in “ocean” of IFC…

Hi Ivan

First of all you have figure out if you need IFC at all: if your primary goal is to transfer geometry to other software maybe some other format is more handy (i.e dxf is widely used).
But if you need to transfer AEC (Architecture, Engineering, Construction) data then IFC is most probably the way to go. What makes IFC more complicated is the fact that there is project data, spatial stucture, object data and geometry (of objects) and grouping of objects (usually used in HVAC and electrical systems). That whole chain could be an overkill if your need is to carry geometry from software to an other.

Anyways, you could take a look to ODA (Open Desings Alliance) IFC SDK: IFC SDK | Open Design Alliance. That is a toolbox that sort of isolates how IFC must be written to file (all the references between objects, types, geometry…).
Please find attached a simple sample of just one pipe presented in IFC.

Here you can download a basic tool for viewing IFC file: KIT - IAI - Downloads
Download FZKViewer 6.5 (Build 2516). It shows raw content using IFC terminology so that you can see what for example that pipe sample contains. FZKViewer has speed issues with bigger files but it is very handy to check smaller ones.

As Igor wrote all this requires quite a lot of ground work at the beginning.
Hope this helps,
Marko


DrainagePipeSimpleSample.ifc (5.9 KB)

Maybe this is a good starting point for sewage with IFC in C#: IfcSharpApps/IfcSharp/hello_pipe at master · IfcSharp/IfcSharpApps (github.com)
Also here you find something about using IFC for pipelines/sewage: MA_Wiedemann_OPUS4_Server.pdf (kobv.de) (only in german)
Good luck!

Hi,
I’m Jon, the developer of the Geometry Gym toolkit.
IFC is a comprehensive and complex data model, and it requires time to learn it.
As an example, creating an IFC with only points or curves isn’t really valid as the geometry needs to “represent” a product, which needs to be contained in a project context and spatial structure. Different model view definitions may refine requirements such as this. The geometry gym toolkit will not validate that you have met requirements such as this, or prevent you from saving files.

To have the greatest success, start with IFC2x3 coordination view and validate the files you create. I personally found Ifc Checking Tool from TUM a great choice, but others are now availalble. KIT - IAI - Downloads If this checking tool reports no errors, you should expect viewers and other software that support your MVD of choice to work.
A lot of my work (and some of the examples I created) were testing advanced use cases, and features of IFC that are not necessarily supported by viewers. I understood that buildingSMART were going to remove the repo with the examples I posted there, and I haven’t maintained it for some time.

Certainly it is recognized that developers new to IFC could benefit from more documentation, better examples etc. Resources for these tasks is a challenge (particularly if relying on volunteer effort).