IFC exporting with user defined property sets?

Hello,
I am trying to create a dynamo graph that exports a specif view of my Revit model in IFC format.

I have found some useful custom Python code in this topic: http://dynamobim.org/forums/topic/export-to-dwf-or-ifc-via-dynamo/

I would like to know if there is a way to export in IFC with user defined property sets directly from dynamo.

At the moment this this is my graph:

I need to create this graph in order to use it with dynamoAutomation on multiple revit projects.

Thanks in advance for your support.

1 Like

Here is a slightly extended IFC dynamo script, created by Based on tools.dwf by Julien Benoit @jbenoit44
and improved byNicklas Verdier Østergaard, nvo@niras.dk.

IFC extended functionality is from here:

refer to the discussion here:

https://sourceforge.net/p/ifcexporter/discussion/general/thread/9ec16258/#d36e

here is the fix:


#python nodes in dynamo 0.7
#proposed by Nicklas Verdier Østergaard, nvo@niras.dk
#Based on tools.dwf by Julien Benoit @jbenoit44
#http://aecuandme.wordpress.com/
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

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

#The inputs to this node will be stored as a list in the IN variable.
#dataEnteringNode = IN

folder=UnwrapElement(IN[0])
name=UnwrapElement(IN[1])
fileversion = IN[2]
wallandcolumnsplitting = IN[3]
exportbasequantities = IN[4]
view = UnwrapElement(IN[5])


#IFCVersion=UnwrapElement(IN[2])

# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
total_export = []

for i,v in enumerate(view):
	options=IFCExportOptions()
	
	#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("ExportInternalRevitPropertySets","true");
	options.AddOption("ExportAnnotations ","true");
	options.AddOption("SpaceBoundaries ", "0");
	options.AddOption("VisibleElementsOfCurrentView ", "true");
	options.AddOption("Use2DRoomBoundaryForVolume ", "true");
	options.AddOption("UseFamilyAndTypeNameForReference ", "true");
	options.AddOption("ExportInternalRevitPropertySets ","true");
	options.AddOption("ExportIFCCommonPropertySets","true");
	options.AddOption("Export2DElements", "false");
	options.AddOption("ExportPartsAsBuildingElements", "false");
	options.AddOption("ExportBoundingBox", "false");
	options.AddOption("ExportSolidModelRep", "true");
	options.AddOption("ExportSchedulesAsPsets", "false");
	options.AddOption("ExportLinkedFiles", "false");
	options.AddOption("IncludeSiteElevation","true");
	options.AddOption("UseActiveViewGeometry", "false");
	options.AddOption("ExportSpecificSchedules", "false");
	options.AddOption("TessellationLevelOfDetail", "0.5");
	options.AddOption("StoreIFCGUID", "true");
	options.AddOption("ExportRoomsInView", "false");
#IFCVersion Version = (IFCVersion) Enum.Parse( typeof(IFCVersion), UnwrapElement(IN[2]), true );
#x.FileVersion = IFCVersion.IFC2x3CV2

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

# End Transaction
TransactionManager.Instance.TransactionTaskDone()

if fileversion == "":
	OUT="Default settings used"
else:
	OUT=total_export
1 Like

Maybe i’m missing the solution, but it seems that the export does not export the “User Sefined Property sets”. Am i right?

Hope to hear from you!

You are right, haven’t found a solution yet. :confused:

Hi everyone,

I am trying to export only the elements of the 3D view, since I am hiding a lot of things, but the sentence below doesn’t work :

options.AddOption("VisibleElementsOfCurrentView ", “true”);

Do you have any ideas about how to make it possible ?