I am trying to get the ActiveProjectLocation.Name out of links in links (everybody thinks Inception right?):
I have a master file, which has several links (12), I can easily fetch the ActiveProjectLocation.Name for all of them. I can also get the Revit Instance Links (68) that are hosted in each and every links of my master file. From the latest, I can collect a fair amount of project information: shared location, file size, worksets, … but the same piece of python script that allows me to get the ActiveProjectLocation.Name of my ‘first level’ links, does not get the ‘2nd level’ ones.
The question is:
- Is it because the links in links info of the Active Project Location cannot be fetch @ a 2nd level / API limitation? - note that I have tried the python code inside a custom node to play with the lacing with the same results = null -
- is it just because of my bad coding skills or because of something that works differently @ the 2nd level fo links?
import clr # clr.AddReference loads and imports .net assembly(dll) as python module # load RevitAPI.dll and RevitServices.dll clr.AddReference("RevitAPI") clr.AddReference("RevitServices") # import filtered element collector and revit link instance classes from Autodesk.Revit.DB import FilteredElementCollector, RevitLinkInstance # import document manager from RevitServices.Persistence import DocumentManager # collect link documents from current document link_docs = UnwrapElement(IN) #rvtLinks = link_docs.ToElements() ProjectLocation =  #Queries for i in link_docs : projloc = i.GetLinkDocument().ActiveProjectLocation.Name #Append Output Lists ProjectLocation.Add(projloc) OUT = ProjectLocation
from Czech Republic with love