Retrieve Project Information Parameters for linked elements

Hi everyone.
This is my issue: I am retrieving a list of elements from linked files, and also the list of Link Instances.
What I want to achieve is to get a list of the elements related with a specific parameter from each Link ‘Project Information’ parameters, as seen in the image attached.
Also you can see the code I wrote to get the specified parameter from ‘Project Information’.
Is there a way to relate the elements with this parameters the same way you do it with revit Schedules?

It would be much easier to get the document directly from the element and then the project info from that document.

@Nick_Boyts Is it possible to get the document directly from an element?. It doesn’t seem to be possible if you read into RevitAPI docs.

Give this a try:

1 Like

@Nick_Boyts Oh I was looking into methods, not properties. That was really easy and finally worked fine for me. So, now I got document from the elements and then ‘Project Information’ so that I was able to iterate over it and get the parameter I was looking for.
Thank you a lot!

Hi David, can you please show us how did you do it. I am trying to do the same thing. Thanks!

Hi @arellan .
Sure. This is the Python code that I used to get that parameter:

import clr
import Autodesk
from Autodesk.Revit.DB import *

from DSCore import List

elements = IN[0]

documents = []
for element in elements:
	document = UnwrapElement(element).Document
information = []
for docu in documents:
	unwrap = UnwrapElement(docu)
	info = FilteredElementCollector(unwrap).OfCategory(BuiltInCategory.OST_ProjectInformation).ToElements()

result = List.Flatten(information, 1)

parameters = []

for res in result:
		building = UnwrapElement(res).LookupParameter('Building').AsString()
		if building :
			parameters.append(building )
			parameters.append('No Information')
		parameters.append('No Information')

OUT = parameters

Thank you so much, David for sharing that! It makes so much sense now.

1 Like