FilteredElementCollector.OfCategory
Description:
Applies an ElementCategoryFilter to the collector.
Applies an ElementCategoryFilter to the collector.
Remarks:
Only elements of this category id will pass the collector.
Only elements of this category id will pass the collector.
public FilteredElementCollector OfCategory(
BuiltInCategory category
)
-
categoryThe category.
// Use OfCategory method to apply an ElementCategoryFilter and fine elements in the Doors category
FilteredElementCollector collector = new FilteredElementCollector(document);
ICollection<Element> doors = collector.OfCategory(BuiltInCategory.OST_Doors).ToElements();