Home - - Dynamo script – Filter elements by their names

Dynamo script – Filter elements by their names

Publisher:
ArchSupply
File size:
20 KB
Date added:
Jan 08, 2024
Licence:
Free
Runs on:
Dynamo
Download
(20 KB)

Filter elements by their names is a free Dynamo script that enables you to create a list of filtered elements using the FilterByBoolMask node. You can use this script to filter out rooms based on targeted names, and create a list of rooms with the same names.

The FilterByBoolMask node is commonly used to filter elements based on a boolean mask. So you need a list of elements and a corresponding boolean mask as a prerequisite. A boolean mask is a list of True/False values corresponding to each element in a given set. The FilterByBoolMask node takes this boolean mask as input and filters out the elements for which the corresponding boolean value is True. In other words, you can use the FilterByBoolMask node to extract the elements that correspond to the True values in the boolean mask.

This script can be part of more complex workflows in Dynamo.

Workflow:

  1. Collect elements. Collect all elements (for example, rooms) in your model, and find their names.
  2. Create a boolean mask. Use the String.Contains node to find elements with the specific word in their names. You will get a boolean mask as the result (a list of true/false values).
  3. Filter elements by a boolean mask. Use FilterByBoolMask to filter list of elements by some shared values or mask. In this case the mask are elements that contain the specified word (for example, “bath”). “IN” output are elements that meet the criteria (True values in the boolean mask).

Gallery

Dynamo script - Filter elements by their names - Screenshot 1
Filter elements by their names: Dynamo graph.