Get the name of the file containing linked element

You could try API, using .Document. Not sure if it will work, it might just return the current doc since the RevitLinkedInstance is considered inside the current doc.

You can try this python for it:

# Enable Python support and load DesignScript library
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

# The inputs to this node will be stored as a list in the IN variables.
if isinstance(IN[0], list):
    elements = UnwrapElement(IN[0])
else:
    elements = [UnwrapElement(IN[0])]

docs = []
for elem in elements:
    doc = elem.Document
    docs.append(doc.Title)

# Assign your output to the OUT variable.
OUT = docs

Edit: Actually you might need to use the LinkElementId class if you can get the elementid. From there you can find the linked element + its name (the file name).

Edit #2: Nevermind, the above python works. Just be careful of the levels, as the Springs node will give you a nested list even if it is just one category, so you may need to flatten it first or add in for loops:

2 Likes