From the course: Dynamo for Revit: Python Scripting

Unlock the full course today

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

Collecting elements

Collecting elements

From the course: Dynamo for Revit: Python Scripting

Start my 1-month free trial

Collecting elements

- [Instructor] In Revit or Dynamo, we often need to find elements in the Revit document, such as a type of wall or window instance, for example. We can do this with a Revit API by using what's known as a FilteredElementCollector object and applying different filters to it. This FilteredElementCollector can be used in three ways, to filter the Revit document, to filter a document and set of element IDs, or to filter a document and a particular view. This is based on the parameters that we provide when creating the object. This will then search through all the elements based on this. However, a collector by itself searches, but it doesn't know what to retrieve until we apply one or more filters to it. As an element passes through the collector, the filter is used to check if it meets a certain criteria depending on what the filter is. For example, checking if the element is of a certain category or family type. There are three types of filters we can use, quick, slow, and logical. And…

Contents