Hi, trying to get the path of linked element. Any idea how to get the linked file path of linked element?
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure 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
import itertools
elementlist =
doc = DocumentManager.Instance.CurrentDBDocument
linkdocs = DocumentManager.Instance.CurrentUIApplication.Application.Documents
#looks for links in the active project, add instances to a list
for linkdoc in linkdocs:
if linkdoc.IsLinked:
collector = FilteredElementCollector(linkdoc)
filter = ElementCategoryFilter(BuiltInCategory.OST_StructuralFraming)
elementlist.append(collector.WherePasses(filter).WhereElementIsNotElementType().ToElements())
#for elem in elementlist:
options = Options()
elem.get_Geometry(options)
OUT = list(itertools.chain(*elementlist))