Filtering Elements in Revit Using Dynamo and the List.FilterByBoolMask Node

Filtering is necessary when using Dynamo to select elements. For example, if we were looking for all exterior doors in a project, we would use Dynamo to grab all the doors in a project and then filter down the ones that have the type Function parameter set to Exterior. Similarly, you may want to filter out elements that meet a condition.

In the following example, you will report all the reference planes in a Revit project which have not been named.

  1. Create a script that will collect all reference planes in a project. You accomplish this by extracting all reference plane elements from the project.
  2. You then check to see which elements have no name by evaluating which ones are equal to an empty string node. This generates a list of elements that is equal in length to the number of true and false values.
  3. You utilize the List.FilterByBoolMask node to feed it both the list of elements and “mask” of true/false values. Essentially, if the list element matches a true, it will be allowed through, otherwise it will be filtered out of the list. The result is a filtered or reduced list of the reference planes which are not named.

This method is a basic skill that allows you to easily create scripts that can work in different project files. The reference plane example is useful because there is no direct way of scheduling all the reference planes in a project using the Revit interface. Similarly, if you had to edit rooms or spaces and select them automatically, you may need to filter the master list of all elements to the subset that you are interested in using a similar method to the one illustrated.

Please note that the sample file used in the screencast is available for download on the Autodesk Knowledge Network.

Edwin Guerra

About

Edwin is a BIM Consultant focusing on Building Performance and Structural Design with Summit Technologies, a leading provider of BIM consulting services based in Vancouver, BC. Edwin’s extensive knowledge of Revit, Dynamo, Navisworks, Bluebeam, Ecotect, Green Building Studio and Autodesk Vasari, is complemented by a passion for Green Building Design.

Leave a reply

Summit Technologies 2015
Vancouver: 604.568.8324 | Calgary: 403.648.9272 | Edmonton: 780.936.8008

604.568.8324