Opensource API for reading IFC Files..

Anonymous

Opensource API for reading IFC Files..

Anonymous
Not applicable

Hi,

Can someone please suggest me an opensource API (SDK) for reading IFC file..

 

thanks

Surya

0 Likes
Reply
10,306 Views
16 Replies
Replies (16)

GeomGym
Advocate
Advocate

Which language?  dotnet (ie c# or vb.net)?

 

I opensourced the core of my IFC library earlier in the year.

https://github.com/jmirtsch/GeometryGymIFC 

 

This will handle IFC2x3 and IFC4 simultaneously, and I'm enabling ifcxml at the moment (and also ifcjson).

 

Some samples are here.

https://github.com/jmirtsch/GeometryGymIFCExamples

 

It's also available from nuget.  

 

There are alternatives, BIMServer.  For c++, I'd suggest trying IfcOpenShell or the CSTB.

ayrus
Participant
Participant
Hello Geomgym,
Many thanks for your prompt response.

Was looking for VB.Net for an option to read geometry and member information -profile etc from an IFC file.

I was getting page not found error when I clicked on the first link. Please could you have a look.
0 Likes

jeremytammik
Autodesk
Autodesk

The correct URL is

 

https://github.com/jmirtsch/GeometryGymIFC

 

You find it immediately if you look at the page pointed to by the second URL.

 

Hey, Jon, this looks great!

 

I had no idea!

 

Would you like me to publish something about it on The Building Coder?

 

If you would like to cobble together a short intro with some examples, that would be really nice.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

mikako_harada
Community Manager
Community Manager

Hi Surya, 

 

Re. Link

 

there is an extra blank at the end in the link.

https://github.com/jmirtsch/GeometryGymIFC

 

You can copy the link directly or go up one folder up. 

 

Regarding generic tools, I see Building Smart org page has several pointers: 

http://www.buildingsmart-tech.org/implementation/get-started/ifc-open-source

 

I must admit that I'm not an expert of IFC. So I cannot comment on them. But FYI. 


Mikako Harada
Developer Technical Services

Anonymous
Not applicable

Hi Jeremy,

 

Many thanks for your prompt response.

 

I have downloaded GeometryGymIFC solution from the link provided by you.

 

There seem to be Math.Net and Rhino Projects added in the solution, requiring certain dlls/app to be installed the PC for using them.

 

Since my objective is to just read coordinates and member incidences to a data-table using VB.net; I am wondering if Math.Net and Rhino projects be removed from the solution?

 

 

It will be of great help if you can help with a sample project for reading coordinates as I have just started with IFC mgmt.

 

thanks & cheers
Surya

0 Likes

jeremytammik
Autodesk
Autodesk

Dear Surya,

 

Thank you for your appreciation.

 

I am pretty sure that nobody will volunteer to do that work for you.

 

You have a simple choice: do it the hard way, or KISS:

 

https://en.wikipedia.org/wiki/KISS_principle

 

I recommend just installing Rhino.

 

The .NET Math library is installed anyway by the .NET framework, if you have a Revit add-in running, or even just Revit itself.

 

Good luck and have fun!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes

Anonymous
Not applicable

Hi Jeremy,

 

Was actually looking for a Standalone API without requiring Revit or Rhino installation.

 

Didn't realize that the API requires Revit installation; thank you for the clarification.

 

cheers

Surya

0 Likes

GeomGym
Advocate
Advocate

Hi Surya,

 

There are multiple dll's that can be built, the primary one has no dependencies other than System.

https://github.com/jmirtsch/GeometryGymIFC/tree/master/DLL%20Projects/GeometryGymIFC

This is also available on nuget if you search for ifc.

https://www.nuget.org/packages/GeometryGymIFC/

 

There are variations such as the rhinocommon, or math.net builds which take advantage of geometric functionality such as transforms, extrusions, mesh etc.  I do hope to add OpenCascade and potentially Revit (  I do still have closed source interfaces with Revit that I use for my revit plugins).

 

If you can post/share an ifc file with the information you wish to extract, I should be able to add to the example repository.

 

Jeremy, if you want to do a blog post on this, great.  If you also have an idea for a test project or sample, this can be developed.  Let me know what else might help.

 

Cheers,

 

Jon

0 Likes

Anonymous
Not applicable

Hi Jon,

 

Sample IFC file along with structure screenshot attached as requested:

 

Desired output is:

 

Mark    Description   Section          Grade              Length  Qty

    1001    COL      UC254*254*73   S275J0              5.000   3
    1002    COL      UC356*368*153  S275J0              5.000   3
    1003    COL      UC305*305*97   S275J0              5.000   3
    1004    BEAM     UB356*171*51   S275J0              6.000   2
    1005    BEAM     UB610*229*101  S275J0              7.200   2
    1006    BEAM     UB178*102*19   S275J0              7.200   2
    1007    BEAM     UB406*140*46   S275J0              6.000   4
    1008    BEAM     UB406*140*46   S275J0              7.200   2

 

cheers

surya

0 Likes

GeomGym
Advocate
Advocate

Thanks, 

 

I improved an existing example to generate your requested table.

https://github.com/jmirtsch/GeometryGymIFCExamples/tree/master/consoleSummarizeElements

 

Note that this algorithm pretty much assumes the ifc file was generated from Tekla with the observed arrangement, you would have to make a more flexible routine to summarize the same output from ifc files created by other software.

 

Hope it helps,

 

Jon

Anonymous
Not applicable

Hi, many thanks for your code!
We have some problems with IFC models that came from Bentley software (we use Revit): Bentley save IFCSLAB as IFCBUILDINGELEMENTPROXY 
Is it possible to update your code to make the converter that will read the one IFC file with IFCBUILDINGELEMENTPROXY and save a new one IFC file with IFCSLAB?

0 Likes

mehdi.Autodesk
Contributor
Contributor

Hi Dear Jon,

 

first of  all thank you for your Post in Autodesk Community,

I am trying to debug the GeometryGymIFC project on Visual studio 2012 and use it as reference in Civil 3D 2016, and i have this error :

 

"Error 21 Invalid token '=' in class, struct, or interface member declaration "

 

Capture1.PNG

 

as I am not so familiar with c# Smiley Sad (i am using vb.net) would you please inform me how can i solve this issue?

 

0 Likes

GeomGym
Advocate
Advocate

I'm using Visual Studio 2015, which has newer versions of c# so I suspect the syntax used there isn't compatible with Visual Studio 2012.

 

If you can't upgrade, then either reference the DLL directly (you can use NuGet to access the compiled version) or there is a branch of code referencing dotnet 3.5 (not sure if this still uses the same syntax.  https://github.com/jmirtsch/GeometryGymIFC/tree/DotNet3.5/DLL%20Projects

 

I can't recall if there is another way to initialize the attributes, using a private variable is one one.

 

Cheers,

 

Jon

mehdi.Autodesk
Contributor
Contributor

Dear Jon,


thank you for your support Smiley Happy. you are absolutely correct, after installing the VS 2015 error removed .

 

sincerely yours,

Mehdi 

0 Likes

Anonymous
Not applicable

Hi Jeremy,

 


This is balaji, i am new to Revit API programming. I am started the exploring method API process.
Currently, i am looking for export current revit file to IFC format, through VB.NET/C#. How to do the export process.

Please help me for further process and guidance.

I have posted my query in the new-post  

 

https://forums.autodesk.com/t5/revit-api-forum/export-revit-file-to-ifc-using-vb-net-c/td-p/7569750


Thnks
Balaji

0 Likes

jeremytammik
Autodesk
Autodesk

Dear Balaji,

 

I answered you directly in your new thread.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes