# Batch IFC to RVT conversion

**URL:** <https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649>\
**Category:** Revit\
**Tags:** ifc\
**Created:** [September 7, 2017, 8:49pm UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649 "2017-09-07T20:49:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![DMK](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dmk/32/67391_2.png) [@DMK](https://forum.dynamobim.com/u/DMK)\
**Post date:** [September 7, 2017, 8:49pm UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/1 "2017-09-07T20:49:46Z")

</div>

Hi, can somebody help with conversation IFC files into RVT. As I cant find any suitable node to work w/ IFC. only few in Bakery package, and thats all. ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/0/00049ca1dbe7d5151948a11964cc225ad241f9ae.jpg)

---

<div class="post-metadata">

**Author:** ![Miltby](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Miltby](https://forum.dynamobim.com/u/Miltby)\
**Post date:** [September 12, 2017, 6:03am UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/2 "2017-09-12T06:03:38Z")

</div>

I have the same issue

It seems dynamo has limited access to the Revit API when it comes to IFC’s…

Can anyone shed some light on this?

---

<div class="post-metadata">

**Author:** ![Jon\_Mirtschin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jon_mirtschin/32/32711_2.png) [@Jon\_Mirtschin](https://forum.dynamobim.com/u/Jon_Mirtschin)\
**Post date:** [September 12, 2017, 9:33pm UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/3 "2017-09-12T21:33:20Z")

</div>

Hi, I’ve enabled a public method in my plguin to permit call of the importer by code. The inputs are an ifc file name, a target revit file name, and a template file name.  
Soon I will add an argument for configuration options.

It’s available in the latest build for 2017, and will be included in the next release for other versions. [http://www.geometrygym.com/installing](http://www.geometrygym.com/installing)

What I’ve struggled with is how to correctly reference the dll and execute the method in python (or similar) in Dynamo. I’m sure this is just my lack of experience and knowledge of this, I’d be very interested to learn how. Loading my dll’s as zerotouch could work if you wade through all the public classes and methods. I wish zero touch could only load public methods etc explicitly tagged.

I’ve attached some test plugin code that shows how this can be executed. There is a reference to dll C:\Program Files\Geometry Gym\Revit\ggRevitIFC2017.dll If there is a way to post a zipped solution, let me know.

I look forward to learning more,

Jon

```
[Transaction(TransactionMode.Manual)]
public class ConvertIFCFiles : IExternalCommand
{
	public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
	{
		string ifcFileName = @"C:\My Work\Geometry Gym\Documents\GeometryGym\BIM\ifc\grasshopper\revit\170816 demo column.ifc";
		string revitFileName = @"C:\My Work\Geometry Gym\Documents\GeometryGym\BIM\ifc\grasshopper\revit\170816 demo column.rvt";
		string templateFileName = @"C:\ProgramData\Autodesk\RVT 2018\Templates\Australia\Structural Analysis-DefaultAUSENU.rte";
		string log = "";
		if(!GGYM.ggRevitIFC.ConvertFile(commandData.Application, ifcFileName, revitFileName,templateFileName, out log))
		{
			System.Windows.Forms.MessageBox.Show(log);
		}

		return Result.Succeeded;
	}
}
```

---

<div class="post-metadata">

**Author:** ![Andreas\_Dieckmann](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andreas_dieckmann/32/365_2.png) [@Andreas\_Dieckmann](https://forum.dynamobim.com/u/Andreas_Dieckmann)\
**Post date:** [September 13, 2017, 3:38am UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/4 "2017-09-13T03:38:33Z")

</div>

@Jon_Mirtschin It would be very cool to have a GeometryGym package for Dynamo. I don’t have too much experience with making ZT nodes but I did experiment with importing the IFC Engine DLL a couple of years ago. What worked for me in terms of cleanup was the following: I created a wrapper class that would reference the DLL and only contained references for those methods I wanted as nodes (declaring them as public, of course).

---

<div class="post-metadata">

**Author:** ![Jon\_Mirtschin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jon_mirtschin/32/32711_2.png) [@Jon\_Mirtschin](https://forum.dynamobim.com/u/Jon_Mirtschin)\
**Post date:** [September 13, 2017, 5:02am UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/5 "2017-09-13T05:02:27Z")

</div>

Well thanks to @Adam_Sheather, I’ve got this working.

You can install Revit 2017 from [https://drive.google.com/file/d/0B8W4\_4YXbIt4ek9mSkh6Y0pCVFk/view?usp=sharing](https://drive.google.com/file/d/0B8W4_4YXbIt4ek9mSkh6Y0pCVFk/view?usp=sharing) (this link will die, go to the Geometry Gym downloads in the future) and I’ve attached a script and image. Look forward to adding more improvements and features in the very near future.

[170913 dynamo convert ifc files.dyn](https://forum.dynamobim.com/uploads/short-url/jXZu5OTb8pdren58uxdsYGJ14e0.dyn) (3.5 KB)

 ![170913 ggDynamoIFC Convert ifc File](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/e/6efe7ed53b281e2395251734e1af8f7b57c53ca8.png)

---

<div class="post-metadata">

**Author:** ![Andreas\_Dieckmann](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andreas_dieckmann/32/365_2.png) [@Andreas\_Dieckmann](https://forum.dynamobim.com/u/Andreas_Dieckmann)\
**Post date:** [September 13, 2017, 6:09am UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/6 "2017-09-13T06:09:30Z")

</div>

@Jon_Mirtschin Great stuff. Just to clarify: this will use the import class mappings file referenced in the Revit.ini?

---

<div class="post-metadata">

**Author:** ![Jon\_Mirtschin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jon_mirtschin/32/32711_2.png) [@Jon\_Mirtschin](https://forum.dynamobim.com/u/Jon_Mirtschin)\
**Post date:** [September 13, 2017, 6:28am UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/7 "2017-09-13T06:28:31Z")

</div>

That can be an input to this, I will soon release a new build with an input for various configuration settings to control this and other aspects of the import process. For time being, if you import a file manually prior, it should subsequently use same settings from dynamo. There is a dialog in the revit importer.

---

<div class="post-metadata">

**Author:** ![zhukoven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/zhukoven/32/70962_2.png) [@zhukoven](https://forum.dynamobim.com/u/zhukoven)\
**Post date:** [September 13, 2017, 8:41am UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/8 "2017-09-13T08:41:51Z")

</div>

There’s no problem in opening IFC directly with python, using the `Application.OpenIFCDocument` Method:  
[http://www.revitapidocs.com/2018/b7929f76-6c0f-1363-4683-8501a0d582a5.htm](http://www.revitapidocs.com/2018/b7929f76-6c0f-1363-4683-8501a0d582a5.htm)  
Also there are some methods defining the IFC import options, so they could possibly be defined during the import process.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/a/fa884b287ce9ee3761d3adca0053ca3eb650c2c9.png)

```
import clr
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

#input IFC file path:
IFCfilepath = IN[0]
#define IFC import options:
IFC = Autodesk.Revit.DB.IFC
IFCopt = IFC.IFCImportOptions 

IFCopen = app.OpenIFCDocument(IFCfilepath)

#Save resulting Revit file to the destination path:
OUT = IFCopen.SaveAs(IN[1])
```

---

<div class="post-metadata">

**Author:** ![DMK](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dmk/32/67391_2.png) [@DMK](https://forum.dynamobim.com/u/DMK)\
**Post date:** [September 20, 2017, 7:35pm UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/9 "2017-09-20T19:35:42Z")

</div>

Seems to be a cool thing, but unfortunately dont work on my end ![Image 141](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/c/3c3df042fc1b46c6f5c57982bb9e6c897b27dc34.jpg). I`ve installed all your libraries ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/e/5ed060cfa522816c3252a341fde41d77666dfab8.jpg)

---

<div class="post-metadata">

**Author:** ![Jon\_Mirtschin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jon_mirtschin/32/32711_2.png) [@Jon\_Mirtschin](https://forum.dynamobim.com/u/Jon_Mirtschin)\
**Post date:** [September 21, 2017, 1:12am UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/10 "2017-09-21T01:12:32Z")

</div>

Thanks, which version of Revit are you using? I’ve uploaded 2018 to [https://geometrygym.wordpress.com/downloads-windows/](https://geometrygym.wordpress.com/downloads-windows/)

It seems you have to replace the dynamo component though if you have a different version of Revit.  
It is possible to build the dynamo dll yourself if you have a different version or Dynamo. I’ve opensourced this, [https://github.com/jmirtsch/ggRevitDynamoIFC](https://github.com/jmirtsch/ggRevitDynamoIFC)

Let me know if this doesn’t help. You should also test the importer manually in Revit, note there is a license required (you will be prompted). I do provide free access to academic use but rely on revenues from commercial users to sustain full time development and support of these tools.

Cheers,

Jon

---

<div class="post-metadata">

**Author:** ![SPARTAN](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/spartan/32/191306_2.png) [@SPARTAN](https://forum.dynamobim.com/u/SPARTAN)\
**Post date:** [January 31, 2018, 2:47pm UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/11 "2018-01-31T14:47:42Z")

</div>

Hi

Are there some changes/updates to this subject?

Thx

---

<div class="post-metadata">

**Author:** ![Jon\_Mirtschin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jon_mirtschin/32/32711_2.png) [@Jon\_Mirtschin](https://forum.dynamobim.com/u/Jon_Mirtschin)\
**Post date:** [February 5, 2018, 3:55am UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/12 "2018-02-05T03:55:24Z")

</div>

Not in particular. Is the existing component not converting models as you desire? I develop improvements on demand, so let me know if you have suggestions.

Cheers,

Jon

---

<div class="post-metadata">

**Author:** ![knarayan](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@knarayan](https://forum.dynamobim.com/u/knarayan)\
**Post date:** [November 21, 2018, 7:03pm UTC](https://forum.dynamobim.com/t/batch-ifc-to-rvt-conversion/14649/13 "2018-11-21T19:03:03Z")

</div>

Great stuff Jon, did you ever get around to including an option for the selection of different IFC class mappings?
