Batch link in Revit models

Link in all Revit models in a folder

I’m trying to use Dynamo to batch link in all Revit models from a file (load new, not reload) for when I have dozens of Revit models that need to be linked into a master file. Assuming that all the Revit models are in the same folder, I was trying to adapt the method and Python script from this post which reloads all Revit links from a folder: Links - "Reload From...".

It’ll successfully load in one of the models, but it will fail on the second Revit model and throw the error:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 44, in
AttributeError: ‘RevitLinkInstance’ object has no attribute ‘LoadFrom’

Another question I had is whether there is a way to specify whether the model is loaded in center to center, origin to origin, with shared coordinates, etc.


#python nodes in dynamo 1.0.0
#originally by Nicklas Østertgaard /

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
collector = Autodesk.Revit.DB.FilteredElementCollector(doc)

folderContents = IN[0]
directoryPath = IN[1]
reloadedlinks = []
options = RevitLinkOptions(False)

for file in folderContents:
ModelPath = ModelPathUtils.ConvertUserVisiblePathToModelPath(file)
newLinkType = RevitLinkType.Create(doc, ModelPath, options)
instance = RevitLinkInstance.Create(doc, newLinkType.ElementId)

instance.LoadFrom(ModelPath, None)



OUT = 0

I have just made this release…

in this is nodes for linking documents included

Hi @polystyrene,

Welcome to the dynamo forum.

The Morpheus package has already the nodes you are looking for with the options center to center, origin to origin and shared coordinates.