Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
is it possible to apply multiple filters to filter out elements without loops?
For example I use ElementMulticlassFilter to filter all Walls, Floors, Ceiling and Roofs, next I would also like to filter out just Basic Walls by WallKind.Basic from that collection of Walls, Floors, Ceiling and Roofs, so that in the end I have BasicWalls, Floors, Ceilings and Roofs.
public ICollection<Element> FindEL(Document doc)
{
IList<Type> types = new List<Type>();
types.Add(typeof(FloorType));
types.Add(typeof(RoofType));
types.Add(typeof(WallType));
types.Add(typeof(CeilingType));
ElementMulticlassFilter filter = new ElementMulticlassFilter(types);
// Apply the filter to the elements in the active document
FilteredElementCollector collector = new FilteredElementCollector(doc);
ICollection<Element> allFamilies = collector.WherePasses(filter).ToElements();
return allFamilies;
}
Solved! Go to Solution.