Introduction To Dynamo - AEC
Introduction To Dynamo - AEC
Introduction To Dynamo - AEC
REVIT 2019
Training Contents
- Geometry basics
- Creating surfaces and solids
- Accessing Revit information
- Placing families in Revit
Session 1 - What is Dynamo?
Visual Programming
Textual Programming:
- More common
- Can use a variety of tools
- Typically not platform dependent
- Can be used to extend Dynamo
Different types of Dynamo
● Dynamo Sandbox
○ Open source visual scripting core without access to Autodesk products or
geometry
● Dynamo Revit
○ Included from Revit 2019 on. Dynamo core plus access to Revit functionality
● Dynamo Studio
○ Core plus access to geometry functionality and DWG import export.
● Dynamo for other Autodesk Products
○ Civil 3D
○ Alias Design
○ FormIT
○ Advance Steel
Accessing Dynamo through Revit
Dynamo can be access through the Revit Ribbon under the Manage Tab.
Exercise:
1. Menus
2. Toolbar
3. Library
4. Workspace
5. Execution Bar
1. Tabs
2. Zoom/Pan buttons
3. Preview Mode
4. Double Clicking on the Workspace
Nodes are the objects that are connected together to form the
program.
Most Nodes in Dynamo are composed of five parts. While there are
exceptions, such as Input Nodes, the anatomy of each Node can be
described as follows:
The Dynamo Library organizes all the Nodes into functional collections
❏ A Library contains
❏ Several Categories
❏ Which have Sub-Categories
❏ Which list the Nodes
Exercise:
Dynamo ships with the standard library that can be seen when opening Dynamo.
There are however, many custom libraries that can be imported into the workspace
that offer further functionality and control. These are called Dynamo Packages.
● Clockwork
● Archi-lab
● Steam Nodes
● LunchBox (recommended for paneling)
And thousands more… Browse through the packages and add one from the list
above.
Managing your Workspace
Dynamo scripts can become incredibly complex incredibly quickly. As a result there are controls built in to help manage all
the information on the workspace. Go through this list and test out each tool, they are as follows:
For the remainder of this session please spend some time getting to know
the interface and controls.
1. Look through the different categories of the Library and start to see
how Nodes are grouped.
2. Right Click in the workspace and search for a specific Node
3. Close the open workspace and look at the resources on the Start page
- scroll down to the Samples and open some up. Look at how the
information is arranged and the types of information flowing through
the nodes.
4. Look at the image on this slide - what do you think the symbols are
beside each category?
5. Find the node that shows the current time, connect it to a Watch
Node
End of Session 1
Session 1 QUIZ
2. Hovering your cursor over a Node's name or icon in the Node Library will do
what?
3. How many wires can connect into one input of any node?
Revit organizes everything in our building into a neat database. Most of what we we will
do in Dynamo is the querying, manipulation, and entry of data into the Revit model.
Data is categorized into different types. Different types of data interact with each other
different.
- Adding two numbers feels natural (2+2=4), but you can hardly add a number and a
line. (2+line=?). Be careful of data transformations and combining different types.
- Types are used to make other types. Number x, number y, number z makes a Point
xyz, which can be used to make a Square with a process that takes 4 Points.
Data Types - Basic Types
Basic data operators will be used often to organize logic in our script.
● Boolean
○ “True” or “False” compose the Boolean type.
○ It is also often used in branched logic paths.
● Integer
○ Integers are whole numbers (0,1,2).
○ Useful for accessing members of a list or generating series.
● Number
○ Number type allows decimal numbers (1.23, 5.511,0.5)
○ Also known as a Double in Dynamo, or a Float in other languages
● String
○ Type associated with text. (“Sheet 1”, “Task-Chair”)
○ Useful for labeling and naming.
○ Can look like a number!
Data Types - Advanced Types
Revit geometry has a set of descriptive data types that compose its objects and families. For
now we can observe the types that make up the geometry data category in this graph. We will
take a deeper dive on Geometry later in the course.
Parametric Formulas
Exercise:
For the remainder of this session we will run through some exercises that help explore
the different data types that are available in Dynamo.
Exercises:
1. Create a linear script, using just number nodes, and solve the following
problem: Sandy has twenty-two dozen golf balls. She hit 15 into the water, 7
across the highway but then bought another dozen. How many golf balls does
she have?
2. Open the fox.dyn file - using concatenation, put the sentence in order to create
the completed String. Try making a list.
3. Open the HowManyBIMS.dyn - Find a way to count how many time the BIM
wikipedia article mentions the word BIM? Does letter case matter?
a. Change all letters to Upper Case
b. Insert a sentence into the existing string.
c. Replace all occurrences of BIM with something else.
d. Remove all spaces and count the total number of letters.
Data Types - Exercises
4. What is a Vector
Dynamo wouldn’t be very helpful if we could only work on one thing at a time.
Lists give us a data structure and a set of functionality that helps us work with a
multitude of things.
One thing that might seem odd is that the first index of a list is always 0, not 1 like
a simple human might expect. This is because a zero-based index is standard
practice in most computation systems and languages.
When looking at Node data output, it is easy to spot a list due to the number in
between the curly brackets. Like this {65} means a list of 65 elements.
The best way to work with lists is to place a Watch node. This way you can
monitor the Indices, nested lists, data type etc… Lists can get confusing!
Lacing
When a Node takes two lists as inputs, how the difference in the size of
the lists get handled by the node will produce different results.
0 1 2 3 4 5 ????????
0 1 2 3 4 5 6 7
Shortest List
This is the default behavior. In shortest list, the node only process up to the length of
the shorter list. The length of the resulting list in the example below is 6.
0 1 2 3 4 5
0 1 2 3 4 5 6 7
Longest List
In longest list, the Node will process to the length of the longer list, repeating the last
entry of the shorter list to match the dangling elements of the longer list. The length
of the resulting list in the below example is 7
0 1 2 3 4 5
0 1 2 3 4 5 6 7
Lacing - Cross Product
Cross Product matches every item on each list with every item on the other list
creating all combinations. The length of the resulting list in the below example is 35
0 1 2 3 4 5
0 1 2 3 4 5 6 7
Lacing in Practice
The best way to understand how this relates to list outputs is seeing it visually in the Dynamo
workspace. Look at the examples below to see the Shortest, Longest and Cross Product.
Now we know what a list is and how it works with other list we can start
to look about how we interact with the list and data inside.
More traditional versions of lists that you might encounter might be:
● A shopping List
● An excel spreadsheet for a building material order
● Netflix
These are all lists that you might want to retrieve certain information
from, based on the lists within the lists. These queries might be:
Similar to the Mathematical and String based operators, Dynamo allows for the access of
information within lists to create the desired result. While there are many, many different
out-of-the-box ways to access list data, let's take a look at a few key Nodes:
● List.GetItemAtIndex
○ This is the fundamental way to query and item at a given index.
● List.Reverse
○ Just as it sounds, this reverses the order of the list.
● List.ShiftIndices
○ This shifts items in a list a given number of indices, like sliding the data from left
and right on a scale - can be good for creating twists in geometry.
● List.FilterByBooleanMask
○ Can remove items on a list based on a Boolean value.
Lists within Lists - Querying Data
Dynamo allows to perform Queries and Actions on these lists. Nodes like
List.Chop and List.Flatten can change the relationships of the data within
the lists, either combining or separating the information where required.
Lists within lists are also able to accessed quickly within version of Dynamo
2.0 and beyond using the List@Level tool, within the Node itself. It can be
accessed by selecting the arrow to the right of an input channel in a Node
and selecting the list level required.
Lists within Lists - Transposing Data
Exercise:
A good way to think of this tool is when you have 5 lists with 10 items each
but you want 10 lists with 5 items each.
Lists Exercises
Open the file NestList_Excel.dyn and look at how we import an existing list (the
excel file) and turn it into a list in Dynamo. There are a few Nodes pre connected to
the Dynamo List so look at the operations they perform.
● Watch - we know
● List.FirstItem - pulls the items at the first Index (0)
● List.RestOfItems - as the name suggests, pulls everything else
Try the following commands with the list and see how you can change how the data
is structured.
5. What Node has Arya Stark used to remove the first 4 Items on
her list?
Session 4 - Code Blocks
They can be used as numbers, strings, formulas, and other data types.
Look at the example to the right and see how instead of 2 or 3 Nodes we
can create a Point using 1 Code Block. Code Blocks can Create, use an
Action or Query, based on existing Node functionalities.
Exercise:
The basic data types are listed in the image to the right but there
are plentiful resources available online. A good place to start is the
Design Script Guide below:
https://dynamobim.org/wp-content/links/DesignScriptGuide.pdf
Code Blocks - Exercise
In this case, we want to find the surface area of each desk and
create a column for it.
Exercise:
Data can be numbers or text, this is what you might typically be used to being called data.
Geometry is also data, in this case, computational geometry is how the computer
represents the information it is provided.
1. Geometry is Data - to the computer and Dynamo, a Bunny not all that different
from a number.
2. Geometry relies on Abstraction - fundamentally, geometric elements are described
by numbers, relationships, and formulas within a given spatial coordinate system
3. Geometry has a Hierarchy - points come together to make lines, lines come
together to make surfaces, and so on
4. Geometry simultaneously describes both the Part and the Whole - when we have a
curve, it is both the shape as well as all the possible points along it
Points
Surfaces are essentially what they suggest. However there are many
different possible operators that might influence how a surface is
created and affected.
The primary surface types that exist are surfaces, NURBS surfaces and
poly surfaces.
If you want to start examining objects with volume, the Solid is the
next step in the process. Solids become more complex as they add
more surfaces. This also provides for more accesibile facets of the
geometry..
Topology is the term that describes the elements that make up a solid.
Not all solids have all Topology elements. The elements are Vertices,
Edges and Faces. These elements are accessible through Dynamo for
further manipulation of the geometry.
Meshes
They also have unique qualities such as Normals. Normals are the
average direction of the faces of the Mesh, basically defined as the in
and out orientation.
Creating Geometry - Points
Creating Geometry begins at the point level. Points then allow for the
creation of curves which then allow for the creation of surfaces and
solids.
Let's start by creating some points. Open up the Points.dyn file and
let's look at the workspace
Once there are points, we have the beginnings of the information that
will feed into our curve calculations. For this exercise we will use a
Nurbs Curve to find the path in between the controls we have
established.
1. Create a Cube
2. Create a sphere
3. Thicken a surface
4. Subtract a form from another solid
Analyzing Geometry
Exercise:
1. Open the SurfaceAnalysis.dyn file
2. Again, go through the production flow to get familiar with how
nodes are interacting.
3. Toggle the controls on the UV surface grid, the resulting points
provide critical information on the surface form.
4. Look at the other analysis tools available like the perimeter
and area.
5. Try using the new list of points as the basis for further
development.
Geometry exploration time
While the information is fresh in your mind, explore the other nodes
and try to think how and when you could use them and what insights
they might provide in your workflow.
This will help for the final part of the session when we build targeted
scripts.
End of Session 5 + 6
Session 5+6 QUIZ
Beyond the ability to select an item singularly, Dynam offers the ability to make
selections based on the Revit Hierarchy. That of course being:
1. Category
2. Family
3. Type
4. Instances
When these selection nodes are placed in the workspace with a Revit Project open,
Dynamo will dynamically link all instances of each category into the workspace for
drop down selections.
Selecting Revit elements
Exercise:
1. Open the SelectingByFamilyType.dyn file
2. Confirm all the Casement Window families
are selected.
3. Connect the final node to edit all the
Windows’ Sill Height parameter.
4. This is only possible because it is an instance
parameter.
5. Edit the script to select other families and
see if you can change an instance parameter
Creating Revit elements
Exercise:
1. Select the top most curve of the glazing facade.
2. Using two "Select Edge" nodes, select each edge
representing the cant at the middle of the facade.
3. Do the same for the bottom edges of the facade in Revit.
4. The Watch nodes reveal that we now have lines in Dynamo.
These curves are the references we'll use to instantiate
adaptive trusses across the facade.
Creating Revit elements
1. Created lists for the curves in the middle and the bottom of
the facade
2. Joined those curves into a PolyCurve
3. Create a list with all 3 lines (2 PolyLines, 1 Line)
4. Create a Code Block to define the number of Trusses
5. Used the Curve.PlaneAtParameter node with the
Geometry.Intersect Node (see points visible in Dynamo)
6. The resulting list we use a List.Map and Flatten Node. and
finally Transpose to arrange the data as we need.
7. Finally, add in the Adaptive Component Node and the
Family Type and select the family from the list.
8. Test the system by changing the number of Trusses input.
Creating Revit elements
Exercise:
1. Recreate the trusses over the courtyard of the Mass.
Revit Views with Dynamo
The Dynamo library has tools that can generate basic views and
sheets based on levels and bounding boxes. With custom Dynamo
packages this can be expanded to suit almost any use-case within
Revit.
Open the ViewAndSheet.dyn file and connect the nodes, input the
values and simultaneously create a view and sheet and place the
view on the sheet as well.
Dynamo Player
The Dynamo Player is a tool that enables the quick use of Dynamo scripts
without having to open Dynamo.
3. Select one face of the roof and place points in a grid on the
surface using the UV system
End of Session 7 + 8
Session 7+8 QUIZ
Now we have covered the basics of Dynamo and how it interacts with
Revit, how you can manipulate elements parametrically and impact
massive automation and control, let's talk about other ways Dynamo can
be used to affect a certain workflow.
Exercise:
Working in small groups, split up the identified tasks and begin looking to
create solutions using Dynamo.