How to get Linked Document and the name?

Hello,

I have trouble with bakery…

So i want to create my own costum-Node:

import clr

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

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

x,d = [],[]

for i in IN[0]:
	x.append(UnwrapElement(i).GetLinkDocument())

for elem in x:
	doc = elem.Document
	d.append(doc.Title)

#To get the doc:
OUT = x,d

I can get the Document but not the name? so where is the Error?

KR

Andreas

The elems in x are already documents. You don’t need to get their document again I think.

1 Like
x,d = [],[]

for i in IN[0]:
	x.append(UnwrapElement(i).GetLinkDocument())
	
	
for elem in x:
	doc = elem
	d.append(doc.Title)
	

#To get the doc:
OUT = x,d

that works!

@Draxl_Andreas If your inputs are RevitLinkInstances, then this (2 lines) should work too:

1 Like