Can`t get linked file, why

Hello,

actually my task is easy, but i got this
grafik

whats wrong here?

import clr
import sys 

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

doc = DocumentManager.Instance.CurrentDBDocument

linked_docs = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_RvtLinks).WhereElementIsNotElementType().ToElements()
lnkInstance = [i for i in linked_docs if i.Name.Contains("FM_E")]
doclnk = lnkInstance[0].GetLinkDocument()

devices = FilteredElementCollector(doclnk).OfCategory(BuiltInCategory.OST_AudioVisualDevices).WhereElementIsNotElementType().ToElements()

OUT = doclnk, devices

… thats the warning for the model is not loaded! :wink: … of course

:rofl:

1 Like