RVTDocs.com

OfCategory

Method
Description:
Applies an ElementCategoryFilter to the collector.
Remarks:
Only elements of this category id will pass the collector.
Syntax
public FilteredElementCollector OfCategory(
	BuiltInCategory category
)
Examples
// 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();
Parameters
Parameter Type Description
category Autodesk.Revit.DB.BuiltInCategory The category.
Return Value
Type Description
FilteredElementCollector Class This collector.