Get all linked documents as instance, how?

Hello,

How can i get all linked Revit files? as a instance ?

i tried copy/paste stuff but “link” is not defined :frowning:

import sys
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

linkDoc = link.GetLinkDocument();

#To get the doc:
OUT = UnwrapElement(linkDoc).Document

2022-03-25_09h51_27

KR

Andreas

Check out my RevitLinks node in Crumple which shows how to get all link instances and their types.

2 Likes