Hi,
I`m trying to get the names of all railings used in a revit model but the filter keeps giving me nonetypes. Can anyone see what I`m doning wrong?
I`m using the following code:
railing_symb_list = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StairsRailing).WhereElementIsElementType().ToElements()
railingtypes=[]
for railing in railing_symb_list:
T=doc.GetElement(railing.GetTypeId())
railingtypes.append([T,T.Name])
Wouter Hilhorst
Solved! Go to Solution.
Solved by naveen.kumar.t. Go to Solution.
Hi @wouter.hilhorst ,
I think there is no need to use the GetTypeId().
try using the below code
FilteredElementCollector railingTypes = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StairsRailing).WhereElementIsElementType();
foreach(Element railingType in railingTypes)
{
string s =railingType.Name;
}
The sollution was indeed to leave auto the elementId. Also I needed to call WhereElementIsNotELementType() instead of WhereElementIsELementType() .
Which gives me the type that I needed.
I`m not sure I completely understand the logic behind this but it works...
thanks for your help!
Can't find what you're looking for? Ask the community or share your knowledge.