Getting Windows and Doors parameter values from Link

i have an issue with the rhythm node [elements.getparametervaluebynametypeorinstance]. im gathering a list of all windows and doors in the Refferenced model. and im trying to sort them by level. the Rhythm node is outputting null values. if i run it using the Elemets.Parameters i get a list that shows the the level at 2 indexs which arnt cosistant per element. You can see in the screen shot when i call index 17 i get a list that returns Levels, IfcGUID, Host Id, finish, and a handful of others. can anyone tell me what im doing wrong or if there is anouther way to get this infomaiton?

You can get parameter values from linked elements just like local elements with a few exceptions. This issue here is that Level is an ElementId parameter. It’s trying to return the actual Level element but that element doesn’t exist in your active project. You might be able to get the level name instead of the element, otherwise you’ll have to use python and the API to get the element specifically from the linked document.

ended up Using Chat GPT to make a Python script to return the elevation of the linked elements

import clr

clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

clr.AddReference(‘RevitServices’)
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument # Current active document

Input: List of linked elements (already retrieved)

linked_elements = [UnwrapElement(el) for el in IN[0]]

Function to get the host level elevation as a string

def get_host_level_elevation(linked_element):
level_id = None

Try different built-in parameters for level reference

level_param = linked_element.get_Parameter(BuiltInParameter.FAMILY_LEVEL_PARAM) # Works for most families

if not level_param:
level_param = linked_element.get_Parameter(BuiltInParameter.HOST_LEVEL_PARAM) ># Works for hosted elements

if not level_param:
level_param = linked_element.get_Parameter(BuiltInParameter.INSTANCE_REFERENCE_LEVEL_PARAM) # Additional check

if level_param and level_param.StorageType == StorageType.ElementId:
level_id = level_param.AsElementId()

if level_id and level_id != ElementId.InvalidElementId:
level = linked_element.Document.GetElement(level_id)
if isinstance(level, Level):
return str(round(level.Elevation, 2)) # Convert elevation to string

return “No Level Found” # Return string instead of None

Process each linked element

output_data = [get_host_level_elevation(linked_element) for linked_element in linked_elements]

OUT = output_data