Export a model using different sites

Hello guys!

I have the same building located in 5 different sites with different layouts, bellow is an ilustration of what i have in my revit model;
I have my base point in the center of the building and I have 5 different locations for this base point
image
image
I’d like to save this revit model in different FILES (it can be in IFC) so I’ll be able to compose my 5 federated model.
does anyone has any workflow to suggest to work on dynamo?

I’m on IFC Export v 22.6.2.0 in R2022.1
There i can make the export
Maybe we should ask @Alban_de_Chasteigner if its available in the Genius Loci Package


image

Hi Marcel,

This option isn’t available in the Export Ifc node from the Genius Loci package.
I’m not currently “calling” the .dll associated with the custom IFC exporter.

Thanks @Alban_de_Chasteigner

Any change of selecting a .json settings file in the exporter?
Or a workaround?

Hi @k.honda,

For starters, the code below is based on the “Export IFC” node of the Genius Loci package, so all credits go to @Alban_de_Chasteigner

If you enter the IFC export settings manually, you then also have the option to save these settings as a *.json file (as @Marcel_Rijsmus also indicates). If you open the exported json file in a text editor, you will get a good insight into all available export options (this differs per exporter and Revit version).

I took advantage of this by modifying Alban’s Python code. Now I need minimal input options, and all other options are fully customizable in the Python code itself. The code below is for Revit2019. I think you could add the option that Marcel mentions.

import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

def tolist(obj1):
    if hasattr(obj1,"__iter__"): return obj1
    else: return [obj1]

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

folder = UnwrapElement(IN[0])
view = tolist(UnwrapElement(IN[1]))
name = tolist(UnwrapElement(IN[2]))
Projectorigin = IN[3]


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

for i,v in enumerate(view):
	#### Define the export options ####
	options=IFCExportOptions()

	options.FilterViewId = v.Id
	options.AddOption("IsBuiltIn", "false")
	options.AddOption("IsInSession", "true")
	options.AddOption("Name", "<In-Session Setup>") # "Name"

	#### "General" Tab ####
	options.AddOption("IFCVersion", "21") # "IFC version"
	#  9 = IFC 2x2 Coordination View
	# 10 = IFC 2x3 Coordination View
	# 21 = IFC 2x3 Coordination View 2.0
	# 17 = IFC 2x3 GSA Concept Design BIM 2010
	# 27 = IFC 2x3 Basic FM Handover View
	# 24 = IFC 2x3 COBie 2.4 Design Deliverable View
	# 25 = IFC4 Reference View
	# 26 = IFC4 Design Transfer View 
	options.AddOption("ExchangeRequirement", "3") # "Exchange Requirement"
	#  0 = Architectural Reference Exchange
	#  1 = MEP Reference Exchange
	#  2 = Structural Reference Exchange
	#  3 = None
	options.AddOption("IFCFileType", "0") # "File type"
	#  0 = IFC
	#  1 = IFC XML
	#  2 = Zipped IFC
	#  3 = Zipped IFC XML
	options.AddOption("ActivePhaseId", "-1") # "Phase to export"
	# -1 = Default phase to Export
	options.AddOption("SpaceBoundaries", "0") # "Space boundaries"
	#  0 = None
	#  1 = 1st Level
	#  2 = 2nd Level
	options.AddOption("SitePlacement", IN[3]) # "Coordinate Base" --IN[4]--
	#  0 = Shared Coordinates
	#  1 = Survey Point
	#  2 = Project Base Point
	#  3 = Internal Origin
	# Set other export options
	options.AddOption("SplitWallsAndColumns", "false") # "Split Walls, Columns, Ducts by Level"
	options.AddOption("IncludeSteelElements", "true") # "Include Steel Elements"
	
	#### "Additional Content" Tab ####
	options.AddOption("Export2DElements", "false")
	options.AddOption("ExportLinkedFiles", "false") 
	options.AddOption("VisibleElementsOfCurrentView", "true")
	options.AddOption("ExportRoomsInView", "false")   

	#### "Property Sets" Tab ####
	options.AddOption("ExportInternalRevitPropertySets", "false")
	options.AddOption("ExportIFCCommonPropertySets","true")
	options.AddOption("ExportBaseQuantities", "false")
	options.AddOption("ExportSchedulesAsPsets", "false")
	options.AddOption("ExportSpecificSchedules", "false") 
	options.AddOption("ExportUserDefinedPsets", "true")
	options.AddOption("ExportUserDefinedPsetsFileName", "G:\\data\\User Defined Property Sets.txt")
	options.AddOption("ExportUserDefinedParameterMapping", "true")
	options.AddOption("ExportUserDefinedParameterMappingFileName", "G:\\data\\Parameter Mapping Table.txt")

	#### "Level of Detail" Tab ####
	options.AddOption("TessellationLevelOfDetail", "0,5")

	#### "Advanced" Tab ####
	options.AddOption("ExportPartsAsBuildingElements", "false")
	options.AddOption("ExportSolidModelRep", "true")
	options.AddOption("UseActiveViewGeometry", "true")
	options.AddOption("UseFamilyAndTypeNameForReference", "false")
	options.AddOption("Use2DRoomBoundaryForVolume", "false")
	options.AddOption("IncludeSiteElevation","false")
	options.AddOption("StoreIFCGUID", "true")
	options.AddOption("ExportBoundingBox", "false")
	options.AddOption("UseOnlyTriangulation", "false")
	options.AddOption("UseTypeNameOnlyForIfcType", "false")
	options.AddOption("UseVisibleRevitNameAsEntityName", "false")
	#options.AddOption("ExportAnnotations ","true")

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

#### End Transaction ####
TransactionManager.Instance.TransactionTaskDone()

OUT='Success'

Hello @MJB-online,

Thank you for your Python code. It worked well for me. However, I’m currently using Revit 2022, and unfortunately, there is no “geographic reference” option available. I assume that exporting the IFC file for different sites through this Python code is not possible in my version of Revit.

I believe there is if you update the IfcExporter

the dynamo routine works perfectly! however this update unfortunately is not working in 2022 as well, I will think about change all my models to 2023 so my workflow will work perectly, thank you very much!