OfCategoryId Method


Applies an ElementCategoryFilter to the collector.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2011

Syntax

C#
public FilteredElementCollector OfCategoryId(
	ElementId categoryId
)
Visual Basic
Public Function OfCategoryId ( _
	categoryId As ElementId _
) As FilteredElementCollector
Visual C++
public:
FilteredElementCollector^ OfCategoryId(
	ElementId^ categoryId
)

Parameters

categoryId
Type: Autodesk.Revit.DB ElementId
The category id.

Return Value

A handle to this collector. This is the same collector that has just been modified, returned so you can chain multiple calls together in one line.

Remarks

Only elements of this category id will pass the collector. If you have an active iterator to this collector it will be stopped by this call.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL

See Also