Trying to pull Base/Top Constraint from linked wall

I am trying to pull the base and top constraints from linked wall elements and am getting GraphicsStyle with the right element ID for the Level but than can’t pull the element id to get the level name.

First of all, you’re already getting the actual GraphicStyle object, not the Id.

But I’m a little confused by what’s happening with your nodes. You’re not getting the level from Base Constraint like you should.
image

Dunno what is happening here?

What does the error say?

image

Hmmm… You might have elements with the same Ids in your model. You might have to go the Python route.

Edit: Can you try this same process on a different project or even a test model?

I relinked a different model and can see level names now but still popping nulls and errors. tried to list unique items and the list lengths match

there is something up with the ids…not sure what though??

I have had similar troubles with Wall instances before. They usually seem to be instances that no longer have geometry. Try selecting that element in Revit with Select by ID.

See if this Python code will work.

import clr
clr.AddReference("RevitNodes")
from Revit.Elements import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

#doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
doc = UnwrapElement(IN[0])
elements = UnwrapElement(IN[1])
paramName = IN[2]
values = []

for element in elements:
	id = element.Id
	element = doc.GetElement(id)
	params = element.GetParameters(paramName)
	for param in params:
		values.append(param.AsValueString())

#Assign your output to the OUT variable.
OUT = values

Inputs are Link Doc, Category, and Parameter Name.

doesnt seem to be working. this is a real wall. i can open up the model and select it…i also show in my screen shot that when run through the element.parameters it does give the Base Constraint value…but when run through element.getparametervalue by name some are popping nulls?

wierd…i tried testing all of the nodes that have parameter by name and only one works. Parameter.ParameterByName

Solved. Thanks Nick for your Help

what happens to the openings in links? has anyone able to collect them?

@Daniel_Almenares Please start new topic this thread doesn’t match your query.

will do thanks