From the course: Revit: Creating C# Plugins

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating a collector

Creating a collector

From the course: Revit: Creating C# Plugins

Start my 1-month free trial

Creating a collector

- [Instructor] With the fundamentals of filtered element collectors under our belt, let's go ahead and create our first one by filtering a Revit document of all elements that match the category of Windows. I've currently got the exercise file open for this video. In here I've gone ahead and created a CollectWindows IExternalCommand which is only retrieving the UIDocument and the Document. Let's use this command to filter the document for Windows. To start, let's simply create a new FilteredElementCollector by creating a FilteredElementCollector variable named collector. And we'll use this to filter the document, meaning it will search the entire document for elements. Next, we'll need to apply a filter to our collector, so let's have a look at some of the quick filters in the object browser. Search for elementQuickFilter. If we expand this class, you can see that we only have access to the base types, that is the classes that the elementQuickFilter inherits. We want to see the derived…

Contents