• Up next:Creating Insertion Point List

Assigning Families to Patterns

0:00 / 0:00

1-3 Assigning Families to Patterns – Practice Exercise

In this exercise, we will assign family types to the A – B – B – C pattern in Dynamo

Task 1: Install the Clockwork package (if it is not installed already)

  1. Check your node library to see if the “Clockwork” package is installed.



  1. If you do not see it, click “Packages” in the menu bar then click “Search for a Package”.
  2. Type “Clockwork” in the search bar.
  3. Click the download arrow next to “Clockwork for Dynamo 2.x” in the results window to install the package.


Task 2: Add Switch node and define cases

  1. Navigate to Clockwork in the node library then click the “Script” category.
  2. In the “Script” category, click “Control Flow” then click the Switch node to add it to your script.
  3. To setup the Switch node, you need to provide a list of cases, a list of values, and a default value.
  4. Double-click on an empty part of screen to add a code block. Enter the following in the code block: [“A”, “B”, “C”] followed by a semicolon as show below.

  5. Connect the output from the code block to the “Cases” input of the Switch node.

Task 3: Create a list of family types

  1. Next, click the List category in the node library. Click the “Generate” heading and click the List Create node to add it to your script.
  2. Click the “+” button two times to add two additional inputs.
  3. In the node library, click the Revit category then click the “Selection” heading. Click the “Family Types” node three times to add three instances of the node to your script.
  4. Select a different window type in each of the Family Types node. These will be the families that get inserted for your window pattern.
  5. Connect the outputs from the Family Type nodes to the List Create inputs. The first node will correspond to the “A” in the pattern. The second to the “B” and so on.

  6. Connect the output of the List Create node to the “Values” input of the Switch node.

Task 4: Finishing up

  1. Connect the output from the first Family Types node to the “Default” input of the Switch node. This is the value that will be used if a value does not match A, B, or C.
  2. Connect the output from the List.Flatten node to the “Check” input of the Switch node.
  3. Type “watch” in the node library search bar and click to add a Watch node to the script.
  4. Connect the Watch node to the output of the Switch node.
  5. Verify that the family types match the letter pattern.

Task 5: Group the Nodes

  1. Pick a spot in the upper left of the Dynamo workspace and click and hold the left mouse button.
  2. Drag the selection window to the lower right-hand corner to select all the nodes.
  3. Right-click and click the “Create Group” option.
  4. Double click the group title and type “Set Families”.
  5. Right-click the group and select a new color
  6. In the menu bar, click Save to save your Dynamo script file. 
  • Up next:Creating Insertion Point List