Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66721

FilteredElementCollector returns ElementType instead of Elements

$
0
0

Hi, i'm trying to make a function that returns a list of elements that have the omniclass BuiltInParameter not set to something empty, i made this function but it's returning a list of the ElementTypes not the Elements themselves.

If anyone could help that would be great.

 

public List<Element> GetElementsWithThisParameter(Document doc, BuiltInParameter param)
{ ParameterValueProvider provider = new ParameterValueProvider(new ElementId((int)param)); FilterStringRule rule1 = new FilterStringRule(provider, new FilterStringEquals(), "", true); ElementParameterFilter filter1 = new ElementParameterFilter(rule1, true); return (new FilteredElementCollector(doc)) .WherePasses(filter1) .ToElements() as List<Element>; }

Viewing all articles
Browse latest Browse all 66721

Trending Articles