Convert IFC 2 Json is a .net Core Library based on GeometryGymIFC.

Requirements: The .Net Core 3.1 must be installed.


Run commande

./ConvertIfc2Json sourcefile.ifc

Run commande with output name

./ConvertIfc2Json sourcefile.ifc output.json

If you don't specify an output name, the name of the Json result file will be "sourcefile.ifc.json".


--indented : if you add this parameter the json will be Formated. --full : if you add this parameter all the IFC will be returned in Json format. --version : display version number

Code documentation

Here is the code structure to extract the IFC elements according to the building hierarchy :

IfcProject (Project)
 |-IfcSite (Site)
   |-IfcBuilding (Building)
     |-IfcBuildingStorey (Building level)
       |-IfcSpace (Space / room)
	     |- IfcElement


Build multi-platform

  1. Install .Net Core 3.1
  2. Start (for MacOS + Linux)


Newtonsoft.Json + MathNet.Spatial + MathNet.Numerics

The packages are installed via the Nuget package manager:

  • Newtonsoft.Json : used for generating and reading Json files
  • MathNet : use to extend geospatial type objects (point 3D, etc.)

Geometry Gym IFC

The library is the most reliable in the IFC transformation world (also used in Revit, Rhino, etc.)

We compile the library for the .NET core environment. Originally, this is only for the .NET (Windows) environment.

Source code :


Recommendation: use Visual Studio 2019+

  1. Hack the file (remove the windows feature) : /IFC/IFC O.cs

  2. Replace in the file > GeometryGym.Ifc.IfcOrganization (L819).

replace that :

string name = ((string)Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", "")).Replace("'", "");
if (!string.IsNullOrEmpty(name) && string.Compare(name, "Microsoft", true) != 0 && string.Compare(name, "HP Inc.",true) != 0)
return name;

by this :

//string name = ((string)Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", "")).Replace("'", "");
string name = null;
if (!string.IsNullOrEmpty(name) && string.Compare(name, "Microsoft", true) != 0 && string.Compare(name, "HP Inc.",true) != 0)
return name;
  1. Change Framework : .NET Core 3.1

  2. Update Nuget package Newtonsoft.Json

  3. Create a file at the root of the folder (update version number) : AssemblyInfo.cs

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("GeometryGymIFC")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("")]
[assembly: System.Reflection.AssemblyProductAttribute("GeometryGymIFC")]
[assembly: System.Reflection.AssemblyTitleAttribute("GeometryGymIFC")]
[assembly: System.Reflection.AssemblyVersionAttribute("")]
  1. Compile (Any CPU)

  2. Copie file in the Ifc2json folder :

    • From Core\bin\Release\netcoreapp3.1\GeometryGymIFCcore.dll
    • To linux + macos + win