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
- [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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Classifying elements5m 22s
-
Retrieving element information6m 39s
-
FilteredElementCollector3m 7s
-
Creating a collector7m 28s
-
Transactions2m 47s
-
Modifying elements5m 30s
-
Creating families7m 54s
-
Querying FilteredElementCollector5m 7s
-
Creating line-based elements6m 55s
-
Creating loop elements5m 59s
-
Get parameter6m 3s
-
Parameter values4m 45s
-
-
-
-
-