# Export a model using different sites

**URL:** <https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208>\
**Category:** Uncategorized\
**Created:** [June 27, 2023, 6:43pm UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208 "2023-06-27T18:43:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![k.honda](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/k.honda/32/135101_2.png) [@k.honda](https://forum.dynamobim.com/u/k.honda)\
**Post date:** [June 27, 2023, 6:43pm UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/1 "2023-06-27T18:43:43Z")

</div>

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](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/f/afc3016383a8bfa0436d42afb7133ab274571c1e.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/8/2894dad5f99cf3b371303d8fcf908c2c4e9c72a6.png)  
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?

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [June 28, 2023, 7:02am UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/2 "2023-06-28T07:02:19Z")

</div>

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](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/5/e577274e21316d0e3b99dde2b32e9d81f26c4212.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/7/27d0554a71e4c819519112ed3e1641e494e9a291.png)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [June 28, 2023, 7:43am UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/3 "2023-06-28T07:43:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [June 28, 2023, 7:55am UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/4 "2023-06-28T07:55:56Z")

</div>

Thanks @Alban_de_Chasteigner

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [June 28, 2023, 8:05am UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/5 "2023-06-28T08:05:40Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/7/47fab88dd87281f7ba0c6f9e7cf47ce01275343c.png)

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [June 28, 2023, 8:28am UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/6 "2023-06-28T08:28:00Z")

</div>

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.

```auto
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'

```

 ![2023-06-28_P01](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/6/0634c88a622a67326147aa3f38fad255bc1b1204.png)

---

<div class="post-metadata">

**Author:** ![k.honda](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/k.honda/32/135101_2.png) [@k.honda](https://forum.dynamobim.com/u/k.honda)\
**Post date:** [July 12, 2023, 6:46pm UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/7 "2023-07-12T18:46:31Z")

</div>

> [@MJB-online](#):
>
> `"Additional C`

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.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [July 12, 2023, 7:50pm UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/8 "2023-07-12T19:50:38Z")

</div>

I believe there is if you update the IfcExporter

> **[Release Release 22.6.2.0 for Revit 2022 · Autodesk/revit-ifc](https://github.com/Autodesk/revit-ifc/releases/tag/IFC_v22.6.2.0)**
>
> General:
> This is the official release of IFC Extension 22.6.2
> Improvements:
> 
> Improved upgrading of IFC user configuration when upgrading a Revit document to a higher version of Revit.

---

<div class="post-metadata">

**Author:** ![k.honda](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/k.honda/32/135101_2.png) [@k.honda](https://forum.dynamobim.com/u/k.honda)\
**Post date:** [July 17, 2023, 12:56pm UTC](https://forum.dynamobim.com/t/export-a-model-using-different-sites/91208/9 "2023-07-17T12:56:58Z")

</div>

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!
