Getting Link Document

Hey, i’ve been trying to get a Revit DB Document of a LinkInstance without any custom nodes or packages, and I found this topic that is marked as a solved, but it doesn’t seem to work for me and I don’t know why.

this is the topic

and this is how it works for me :confused:

Import RevitNodes so the Python intrepeter knows which assembly to call UnwrapElement() from:

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

Still returns no attribute… does it matter in what order I import clrs?

1 Like

OUT=UnwrapElement(IN[0])[0].GetLinkDocument()

or add a firstitem node after the RevitLinkInstance or modify you script to process list.

2 Likes

this worked! so it tried to get linkDocument of a list, not an element in the list… that’s why Flattening didn’t help, thanks again for helping out!

1 Like

I would like to get a list with sublist as well, not a single result