# Batch link in Revit models

**URL:** <https://forum.dynamobim.com/t/batch-link-in-revit-models/33999>\
**Category:** Revit\
**Created:** [March 26, 2019, 7:31pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999 "2019-03-26T19:31:44Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![polystyrene](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@polystyrene](https://forum.dynamobim.com/u/polystyrene)\
**Post date:** [March 26, 2019, 7:31pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/1 "2019-03-26T19:31:45Z")

</div>

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..."](https://forum.dynamobim.com/t/links-reload-from/13224).

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.

Thanks!

```
#python nodes in dynamo 1.0.0
#originally by Nicklas Østertgaard nvo@bimshark.com / nvo@shl.fk

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference(&quot;RevitNodes&quot;)
import Revit
clr.ImportExtensions(Revit.Elements)

# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)

# Import DocumentManager and TransactionManager
clr.AddReference(&quot;RevitServices&quot;)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *

# Import RevitAPI
clr.AddReference(&quot;RevitAPI&quot;)
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
collector = Autodesk.Revit.DB.FilteredElementCollector(doc)

folderContents = IN[0]
directoryPath = IN[1]
reloadedlinks = []
TransactionManager.Instance.EnsureInTransaction(doc)
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)

reloadedlinks.append(RevitLinkType)

TransactionManager.Instance.TransactionTaskDone()

OUT = 0
```

---

<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:** [March 26, 2019, 9:11pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/3 "2019-03-26T21:11:27Z")

</div>

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.

 ![Link%20model](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/6/66c3080a5530adb87d8c7fc6b867badd4aa780f3.png)

---

<div class="post-metadata">

**Author:** ![acandelario](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@acandelario](https://forum.dynamobim.com/u/acandelario)\
**Post date:** [August 22, 2019, 6:22pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/4 "2019-08-22T18:22:53Z")

</div>

Dear @Alban_de_Chasteigner,

I have tried to use these nodes, but the nodes return “Function” and no-link in load in the opened project. I am using Revit 2020 and Dynamo 2.1.0.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/f/2f9a7b4501c434dd48d2c53d5f3af92538b0a083.png)

Please, find attached dyn file:  
[Cargar Links Masiva.dyn](https://drive.google.com/open?id=1fAjua_y_t71R422sZ3tQzWDE_Voul5Fj)

Any idea???

---

<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:** [August 22, 2019, 7:49pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/5 "2019-08-22T19:49:45Z")

</div>

Hi,

Make sure that the Default Value is checked (with right-click).  
When the node is totally light grey, it means that an input is missing.

 ![Default%20value](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4ecce386976f70485e96c47486e116b58da7ac08.png)  
 ![link%20model](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/0/90fd6ebd5473d7b4c9ed857f813b753099e56b7c.png)

---

<div class="post-metadata">

**Author:** ![acandelario](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@acandelario](https://forum.dynamobim.com/u/acandelario)\
**Post date:** [August 22, 2019, 8:37pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/6 "2019-08-22T20:37:58Z")

</div>

Many thnaks for your prompt response @Alban_de_Chasteigner

However, I can not select with right click “Use Default Value” in node input “ClosedWorsetNamesContain\_optinonal” since, as seen in the image, there are not any default value defined inside custom node.

 ![Captura2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/3/b3b80097bed52e7a40ee3c284648779bde685ca7.png)

What is the default value that should be define inside custom node? Or could you share DYN file that you did in your second image?

Many thanks for your help

---

<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:** [August 22, 2019, 8:43pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/7 "2019-08-22T20:43:09Z")

</div>

I have a sligthly different version.

 ![linkmodel](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/d/8d1650418cbfe36ee4d86d84b476497122f7c9fc.png)

You can update the _Morpheus_ package or maybe add the missing `= None` in the dyf file.

---

<div class="post-metadata">

**Author:** ![acandelario](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@acandelario](https://forum.dynamobim.com/u/acandelario)\
**Post date:** [August 22, 2019, 8:45pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/8 "2019-08-22T20:45:15Z")

</div>

Many thanks Alban. Now, it is solved and everything works right

---

<div class="post-metadata">

**Author:** ![Revit\_Noob](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@Revit\_Noob](https://forum.dynamobim.com/u/Revit_Noob)\
**Post date:** [August 27, 2019, 2:25am UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/9 "2019-08-27T02:25:40Z")

</div>

Sorry to resurrect this thread, i cannot use Morpheus package as I am running v1.3 of Dynamo.

Can i have the Phyton Script instead so i can recreate the node. Link Model via Shared Coordinates?

---

<div class="post-metadata">

**Author:** ![Bapollo](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@Bapollo](https://forum.dynamobim.com/u/Bapollo)\
**Post date:** [December 5, 2019, 6:46pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/10 "2019-12-05T18:46:49Z")

</div>

Hi!

I contemplated, creating a new topic for this, but there still might be some interest in this here, so I’m trying instead of flooding with very similar questions. If there are no responses I might create a separate thread.

I wish to do something similar to this, but instead of the workflow described here in this topic and summarized below:

- “I have many revit projects - I wish to link them all into one project quickly”  
The situation being that there is a “main file” and a lot of projects (list) needs to be linked into this main file.

Instead I wish to link one project containing few identifying elements into many project files. The reason could be to visually be able to compare them in different ways.  
Therefore the situation is:

- “I have many revit projects - I wish to link one specific project into each separate project and save”  
So I need a list of projects and a path to one specific project and a way to open all the projects from the list, and link the project in the specific path into each.

Both Zhukoven and the Morpheus packages has tools that link a lot of files into the open files. But is it possible to do as described with these tools or is there something else out there that can help?

Added note:  
Ideally I would like to bind the single linked project into each project file - however it seems this is impossible through dynamo - so perhaps the different “copy/insert” workflows that are in the forums might help - This is not the main part at this moment however 🙂

It has been a while since I fiddled with Dynamo, so apologies if I’m missing something very obvious.

Thanks a lot,

---

<div class="post-metadata">

**Author:** ![cams.cua](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@cams.cua](https://forum.dynamobim.com/u/cams.cua)\
**Post date:** [July 13, 2020, 6:57am UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/11 "2020-07-13T06:57:03Z")

</div>

Hi @Revit_Noob were you able to solve this? I tried this but i cannot seem to make it work. I am using Revit 2020 at the moment

---

<div class="post-metadata">

**Author:** ![cams.cua](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@cams.cua](https://forum.dynamobim.com/u/cams.cua)\
**Post date:** [July 13, 2020, 6:58am UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/12 "2020-07-13T06:58:22Z")

</div>

We have the same problem i cannot find the 3rd line how did you solve this? This is what mine said _"document already contains a linked model at path path._

_parameter name: path"_

---

<div class="post-metadata">

**Author:** ![peterchrien](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@peterchrien](https://forum.dynamobim.com/u/peterchrien)\
**Post date:** [February 9, 2023, 11:22pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/13 "2023-02-09T23:22:14Z")

</div>

What helped me was using Transaction.End-Transaction.Start, and syncing files from Desktop Connector.

 ![Load links from path_2023-02-09_11-19-06](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/687ac76b02920e8251e70119fab55ed104564b98.png)

---

<div class="post-metadata">

**Author:** ![paulo.goveia](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@paulo.goveia](https://forum.dynamobim.com/u/paulo.goveia)\
**Post date:** [February 16, 2024, 12:05pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/14 "2024-02-16T12:05:34Z")

</div>

Is it possible to link cloud model as well?

---

<div class="post-metadata">

**Author:** ![Pratik.Sodde](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pratik.Sodde](https://forum.dynamobim.com/u/Pratik.Sodde)\
**Post date:** [May 14, 2024, 12:10pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/15 "2024-05-14T12:10:30Z")

</div>

I have the same question, did you find any solution for linking from ACC or BIM 360 using dynamo?

---

<div class="post-metadata">

**Author:** ![paulo.goveia](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@paulo.goveia](https://forum.dynamobim.com/u/paulo.goveia)\
**Post date:** [August 9, 2024, 9:31pm UTC](https://forum.dynamobim.com/t/batch-link-in-revit-models/33999/16 "2024-08-09T21:31:22Z")

</div>

not so far
