Trying to pull Base/Top Constraint from linked wall


#1

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.


#2

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.


#3

Dunno what is happening here?


#4

What does the error say?


#5

image


#6

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?


#7

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


#8


#9

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


#10


#11

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.


#12

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.


#13

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?


#14

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