• Up next:Assigning Families to Patterns

Define Patterns in Dynamo

0:00 / 0:00

1-2 Defining Design Patterns in Dynamo – Practice Exercise

In this exercise, we will define a A – B – B – C pattern in Dynamo

Task 1: Open Revit and Dynamo

  1. Open Revit and create a new project file using the “imperial-architecture” template.
  2. In the “Manage” ribbon, click the “Dynamo” button to launch Dynamo.
  3. Once Dynamo opens, click the “New” button to create a new script file

 

Task 2: Define the pattern sequence

  1. Double click an empty space in the Dynamo workspace to create a node block.
  2. Type the letter A in quotes followed by a semicolon in the code block. Press the “Enter” key to create a new line.
  3. Type the letter B in quotes followed by a semicolon. Press the “Enter” key to create a new line.
  4. Type the letter B in quotes followed by a semicolon. Press the “Enter” key to create a new line.
  5. Type the letter C in quotes followed by a semicolon.
  6. Your code block should look like the following:


Task 3: Create a list

  1. In the node library, navigate to the “List” category and click the “Generate” heading.
  2. Click the List Create node to add it to your script.
  3. Click the output arrow next to the “A” in the code block and connect it to the “0” input of the List Create node.
  4. Click the “+” arrow and add three more inputs.
  5. Connect the rest of the outputs from the code block to the List Create node.

Task 4: Repeat the list

  1. In the node library, click the OfRepeatedItem node in the “Generate” section of the “List” category.
  2. Connect the output from the List Create node to the “item” input of the List.OfRepeatedItem node.
  3. Type “integer slider” in the node library search bar. Click to add the Integer Slider to your script.
  4. Connect the output of the Integer Slider to the “amount” input of the List.OfRepeatedItem node.
  5. Set the Integer Slider to 10.
  6. Type “watch” in the node library search bar and click the add a Watch node to your script.
  7. Connect the output of the List.OfRepeatedItem node to the watch node.
  8. Adjust the slider on the Integer Slider and observer the results in the Watch node.
  9. Reset the Integer Slider to 10.

Task 5: Flatten the list

  1. In the node library, navigate to the “List” category and click the “Modify” heading.
  2. Click the “Flatten” node to add it to your script.
  3. Connect the List.OfRepeatedItem output to the “list” input of the List.Flatten node.
  4. Leave the “amt” input empty.  
  5. Hover over the bottom right-hand corner of the List.Flatten node to see the preview from the node. Confirm the nested lists have been removed.

Task 6: 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 of the nodes.
  3. Right-click and click the “Create Group” option.
  4. Double click the group title and type “Define Pattern”.
  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:Assigning Families to Patterns