IFC export AddOptions don't work

Hi guys,

I am using the custom node “Export IFC” from GeniusLoci.
This Python script refers to AddOptions such as: options.AddOption(“ExportLinkedFiles”, “false”)

However, despite all the comments on these forums the options don’t seem to do anything here…
If i set the ExportLinkedFiles option to “true” it doesn’t export the linked file in my model.
None of the options seem to work, tested multiple.
Am i doing something wrong here? If so, what can i do to fix this problem?

The Python script:

#Proposed by Nicklas Verdier Østergaard, nvo@niras.dk
#Revised by Alban de Chasteigner

import clr
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
import Revit
# Import geometry conversion extension methods
# Import DocumentManager and TransactionManager
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
import Autodesk
from Autodesk.Revit.DB import *

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

view = UnwrapElement(IN[2])
fileversion = IN[3]
wallandcolumnsplitting = IN[4]
exportbasequantities = IN[5]
Projectorigin = IN[6]


result = []

for i,v in enumerate(view):
	#if fileversion != None:
	#	options.FileVersion = fileversion
	if fileversion == "IFC4":
		options.FileVersion = IFCVersion.IFC4
	if fileversion == "IFC2x2":
		options.FileVersion = IFCVersion.IFC2x2
	if fileversion == "IFC2x3":
		options.FileVersion = IFCVersion.IFC2x3
	if fileversion == "IFC2x3":
		options.FileVersion = IFCVersion.IFC2x3CV2
	if fileversion == "IFCBCA":
		options.FileVersion = IFCVersion.IFCBCA
	if fileversion == "IFCCOBIE":
		options.FileVersion = IFCVersion.IFCCOBIE
	if fileversion == "":
		options.FileVersion = IFCVersion.Default
	options.WallAndColumnSplitting = wallandcolumnsplitting
	options.ExportBaseQuantities = exportbasequantities
	options.FilterViewId = v.Id
	options.AddOption("ExportAnnotations ","true");
	options.AddOption("SpaceBoundaries ", "0");
	options.AddOption("ExportRoomsInView", "false");	
	options.AddOption("Use2DRoomBoundaryForVolume ", "false");
	options.AddOption("UseFamilyAndTypeNameForReference ", "true");
	options.AddOption("Export2DElements", "false");
	options.AddOption("ExportPartsAsBuildingElements", "false");
	options.AddOption("ExportBoundingBox", "false");
	options.AddOption("ExportSolidModelRep", "true");
	options.AddOption("ExportSchedulesAsPsets", "false");
	options.AddOption("ExportSpecificSchedules", "false");
	#Doesn't work. It would be necessary to use OpenInBackground.
	options.AddOption("ExportLinkedFiles", "false");
	options.AddOption("StoreIFCGUID", "true");
	options.AddOption("VisibleElementsOfCurrentView", "true");
	options.AddOption("UseActiveViewGeometry", "true");
	options.AddOption("TessellationLevelOfDetail", "1");
 	options.AddOption("SitePlacement", IN[6]);
#	options.AddOption("ExportUserDefinedPsetsFileName","the filepath")
#IFCVersion Version = (IFCVersion) Enum.Parse( typeof(IFCVersion), UnwrapElement(IN[3]), true );
#x.FileVersion = IFCVersion.IFC2x3CV2

	c=doc.Export(folder, name[i], options)

# End Transaction

if fileversion == "":
	OUT="Default settings used"

Thanks in advance :slight_smile:

Hi @m.morsink

First read the Revit IFC manual.
Tons of information there.

Then have you installed the Revit IFC exporter from

This gives you extra options.

If so, have you chosen the IFC4 format?

Hi @m.morsink,

I’m glad you find the package Genius Loci useful.

Did you see the comment above the line "options.AddOption(“ExportLinkedFiles” ?
I wrote “It doesn’t work because it would be necessary to use OpenInBackground.”

When you use the IFC export in Revit, you will see that the linked files will be opened a few seconds.
So with dynamo, you need to do the same thing : open all the linked files in background to export them in IFC.

Hope that makes sense.

thank you for your fast reply. I am familiar with the manual for IFC, and i have IFC for Revit installed on my pc. I also tried to use multiple IFC types. Didn’t help unfortunately…

Thank you for your fast reply. I noticed the note in the pythonscript. Maybe i used the wrong example for this topic. But none of the Options seem to work.
F.e. the “ExportRoomsInView” doesn’t work either.
Btw. I am using Revit 2017 at the moment, not sure if that can influence the success?

Autodesk have made efforts to improve IFC export in Revit 2018 and again in Revit 2019, so yes


I tried with options.AddOption(“ExportRoomsInView”, “true”); and it worked perfectly :

Did you notice that “ExportRoomsInView” and “UseActiveViewGeometry” must be set together on true ?

Is the IFC file exported when you edit the python script ?


yes, i am aware of the dependency of those two with the IFC export option!

as you can see, both are set to “true”. When i change the status from “false” to “true” the node still works, and it exports to IFC like it’s supposed to do, but not with the options i want it to have.
Maybe it’s the Revit version that’s causing the problems, like @m.rijsmus says…

My previous try was with Revit 2018 and I have now tested with Revit 2017.
It works, so the error is probably not inside the python script.
Do you edit the custom node “Export IFC” and save changes or do you copy the python script to your graph ?

ah, okay, so the version is not the problem…
I edit the custom node “Export IFC” and save changes

Can you confirm that you are exporting a 3D view ?


see pictures above. As you can see, i selected a 3D view, called PINO.
I used the .dyn file you sent in your reply. But as you can see the Rooms are not exported…

When I open an IFC file with Naviswork, I can not find any room either !
Open your IFC with Tekla Bimsigth or Solibri instead. :grinning:

damn… that’s the problem, i assumed it would be visible in any program
When i load the IFC file back into Revit it shows the room with the correct name.

Thanks a lot!

I have just released an update which includes IFC export… Would be great to get this tested for external linked files as well :slight_smile: