Introduction To Dynamo - AEC

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 82

AUTODESK DYNAMO TRAINING FOR DOKA

REVIT 2019
Training Contents

Day 1 - Introduction to Visual Programing Day 3 - Creating workflows

- What is Dynamo - Determining potential


- Data Types - Creating Scripts
- Working with lists - Implementing automation
- Code Blocks and Data output

Day 2 - Geometry and Revit

- Geometry basics
- Creating surfaces and solids
- Accessing Revit information
- Placing families in Revit
Session 1 - What is Dynamo?

Dynamo is visual programming for BIM and design.

Programming is the use of algorithms to achieve a


desired result.

Algorithms are a procedure, process or formula that is


followed in an exact order to solve a problem.

Revit is a system of interconnected algorithms. Some


are activated through the interface, like the Save
button. Others are accessible through the Application
Programming Interface (API).

Dynamo gives the user the ability to write algorithms


using the Revit API while providing a visual reference
and connection.
Visual vs Textual programming

Visual Programming

- Usually more purpose oriented


- The “development environment” is the programming application itself
- Functionality tied to what the developers have released

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 was previously an additional Add-In to Revit, it therefore followed a different


development cycle to Revit. Subsequently there are different types of Dynamo and different
ways to access them.These are:

● 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. Everyone please open the Training File in Revit


2. Open Dynamo from the manage Tab
3. Check the Version is correct (2.0 and above)
4. Spend a moment getting to know the interface
The Dynamo Interface

The Dynamo interface is made up of 5 Regions.

1. Menus
2. Toolbar
3. Library
4. Workspace
5. Execution Bar

All together they make up the workspace where


the visual programs are composed.
The Dynamo Workspace

The Dynamo workspace can be accessed using the


following controls:

1. Tabs
2. Zoom/Pan buttons
3. Preview Mode
4. Double Clicking on the Workspace

The make up the workspace where the visual


programs are composed.

Switch between the Node and Wire view to the


Preview mode by using ‘Ctrl+B’
The Anatomy of a Visual Program

Dynamo enables us to create visual programs using two primary tools


called Nodes and Wires.

Nodes are the objects that are connected together to form the
program.

Wires create relationships between Nodes and establish the flow of


information and process in the visual program.
Nodes

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:

1. Name - The Name of the Node with a Category.Name naming


convention
2. Main - The main body of the Node - Right-clicking here presents
options at the level of the whole Node
3. Ports (In and Out) - The receptors for Wires that supply the input
data to the Node as well as the results of the Node's action
4. Lacing Icon - Indicates the Lacing option specified for matching
list inputs (more on that later)
5. Default Value - Right-click on an input Port - some Nodes have
default values that can be used or not used.
Wires

Wires connect between Nodes to create


relationships and establish the Flow of our
Visual Program. We can think of them literally
as electrical wires that carry pulses of data
from one object to the next.

Wires connect the output Port from one Node


to the input Port of another Node. This
directionality establishes the Flow of Data in
the Visual Program.

We create a Wire by left clicking our mouse on


a Port and then left clicking on the port of
another Node to create a connection.
The Dynamo Library

The Dynamo Library organizes all the Nodes into functional collections

❏ A Library contains
❏ Several Categories
❏ Which have Sub-Categories
❏ Which list the Nodes

Exercise:

1. Browser the Dynamo library


2. Drag some nodes onto the workspace
3. See if you can connect them using wires
4. Click the port to initiate the wire connection
The Dynamo Library

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.

Some of the most popular custom libraries are:

● 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:

1. Alignments - accesses through the right-click


2. Notes - ‘Ctrl+W’ this helps reference steps for later or others
3. Grouping - ‘Ctrl+G’ this is a way to capture a certain action within the script
Explore the Workspace

For the remainder of this session please spend some time getting to know
the interface and controls.

Some areas for exploration are:

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

1. When solving a problem using an algorithm in Dynamo rather than Revit,


can algorithms can be reused so that you have an instant solution next time
you encounter a problem you've solved with Dynamo?

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?

4. How can you access the Library of Nodes?

5. What is the keyboard shortcut for grouping Nodes

6. What is the keyboard shortcut for creating a note?


Session 2 - Data Types

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 generated by everything we do.


- Revit is at its core an interface to interact with a database.
- We can leverage this structure to make meaningful automations

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

Often you will encounter some advanced types, especially when


querying existing Revit geometry.

● Advanced types often can be broken down into its


component types in specific ways, such as finding the
Midpoint of a Curve
● Some Node operations are only possible with advanced
types.
● Advanced types are often better descriptions of real world
objects and interactions.
Data Operators

If the simplest form of data is numbers, the easiest way to


relate those numbers is through Mathematics.

From simple operators like divide to trigonometric functions, to


more complex formulas, Math is a great way to start exploring
numeric relationships and patterns.
Geometric Data 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

Just like in Revit, Dynamo allows for dynamic parameters


that allow the user to control the inputs in a flexible
manner.

The most common example of this that you will find in


Dynamo is the Number and Integer sliders that can move
between defined ranges.

Exercise:

1. Open the Parametric Formulas.dyn file


2. Adjust the sliders and observe the changes
3. Take a quick look over the rest of the script to see
what is happening in the workspace.
Data Types - Exercises

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

● Open up the GeometricsData.dyn file and connect


the nodes to create a result. Once complete, change
the inputs at the beginning of the script to notice the
change in the end result.
End of Session 2
Session 2 QUIZ

1. What is the Boolean result of these sentences.


a. “James wasn’t not unhappy with his performance’ Is James happy?
b. Cindy said “It wasn’t like she was not-not into it’ Was Cindy into it?
c. Tom said he was pleased with his work despite everything. Is Tom pleased?

2. What is the highest value Integer here?


a. 56
b. 78.659999
c. 81.1
d. 75.01

3. What is a Double? Is there another name for this?

4. What is a Vector

5. What geometry data type would an Ellipse be?


Session 3 - Working with Lists

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.

- Lists are collections of items. Processes can be applied across the


selection.
- Lists can contain other lists, but nesting lists too heavily will make the data
confusing to work with.
- List operations such as Select, Filter, and Join gives us tools to manipulate
what part of lists are passed along to downstream processes.
- Node inputs only take 1 wire but lists enable multiple inputs through the
same wire to iterate the node task.
Zero-Based Indices

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.

For example, the Third item in a list would be at the Index of 2.

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

Data matching is a problem without a clean solution. It occurs when a


node has access to differently sized inputs. Changing the data matching
algorithm can lead to vastly different results.

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.

Shortest Longest Cross Product


Accessing Lacing options

To control how list interact with other in this way


you can right click on the Node that performing the
lacing operation and select the desired method.
Working with Lists

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:

● How many bananas do I need to buy


● What is the manufacturer of this framing vs that framing
● What are the movies inside the Action category (list)
List Operations

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

If we have a box of decks of cards, we have an example of a potential list


within a list. Each card deck is a list within itself that has information
about suite, number etc..

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

Transpose is a fundamental function when dealing with lists of lists. Just as


in spreadsheet programs, a transpose flips the columns and rows of a data
structure.

Exercise:

1. Open the ListTranspose.dyn file from the Session 3 folder


2. Examine the list being created by the Integer sliders.
3. Notice we are creating polylines with the same list. The only
difference is that due to the transpose node we have switched the
x/y relationship of the data.

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.

1. Create a list of only the description field


2. Find the widest desk using Nodes
3. Filter out any desks wider than 60 inches and show the remaining in a list
4. Get a count of all desks based on the quantities using nodes
End of Session 3
Session 3 QUIZ

1. What is the index number of Bananas in the following list?


a. Carrots
b. Beans
c. Bananas
d. Oranges
e. Apples

2. What is the lacing term for running all possible combinations of


a list with another list?

3. What is the Node called that switches a lists structure?

4. Inside a Node, how do you call a list within a list?

5. What Node has Arya Stark used to remove the first 4 Items on
her list?
Session 4 - Code Blocks

The code block is a unique feature in Dynamo that dynamically links a


visual programming environment with a text-based one. The
code-block has access to all of the Dynamo nodes and can define an
entire graph in one node.

Code blocks are a window deep into DesignScript, the programming


language at the heart of Dynamo.

They can be used as numbers, strings, formulas, and other data types.

Code blocks can be created by searching in the Dynamo Library but by


far the quickest way to access a Code Block is by double-clicking in the
workspace.
Code Blocks - DesignScript Syntax

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.

To lightly touch on the syntax of DesignScript we can observe the naming


of the Nodes in the workspace. Notice how they use the dot notation
between the element and the function.

A quick way to learn how different Nodes are represented in DesignScript


is to select a group of Nodes and right-click in the workspace and click
Node to Code.

Exercise:

1. Open the DesignScript_NodeToCode.dyn file.


2. Select the different groups and select Node to Code.
Code Blocks - Shorthand

Learning the Code Block shorthand will save substantial amounts of


time once you are a confident Dynamo user and want to create
scripts quickly.

The most basic data type is numbers, which require no additional


syntax (unless below 1 like .045, this would need to be entered as
0.045)

Strings require quotation marks “Like this”

Ranges use double stops: 0..7..4;

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

Spend some time experimenting with Code Blocks in a new


Workspace. Try the following tasks using Code Blocks:

1. Create two strings and join them together.


2. Create a Range and create points based on that Range.
3. Create a circle based on a center point
4. Create a sequence and get the item at Index 4
Data Output - Report to Excel

While using Dynamo we may eventually create a list with


information that we wish to export to a different environment to
interact with. This exercise will use Excel as the target destination.

In this case, we want to find the surface area of each desk and
create a column for it.

Exercise:

1. Open the PushTo_Excel.dyn file. - some guiding nodes have


been left in, try and fill in the rest.
2. Make sure Dynamo is set to run Manually
3. Locate the Previous Excel file in the Dynamo Input
4. Locate the destination file at the end of the workspace.
5. Try and connect the Nodes up to create a new column in the
excel that shows the Area in Square Feet
Data Output - Report to Excel

Continuing on from the previous exercise, continue to interact with


the excel file by pushing data from Dynamo.

Try the following exercises:

1. Change the column names


2. Make a rule for the ‘overwrite’ function
3. Add a new desk size and add the quantity
4. Add a new desk-hardware column
End of Session 4
Session 4 QUIZ

1. What is the Syntax for writing a String?


2. What is the Syntax for writing a Sequence?
3. How do you find out what the DesignScript might look like in
any given group of Nodes?
4. How do you quickly create a Code Block?
5. How do you create a point in the workspace using one Code
Block?
6. What is the Square footage of the largest Desk area?
Session 5+6 - Geometry Basics

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.

As defined in the Dynamo Primer, Geometry is the following:

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

Points are at the root of any geometric operation


and have a lot of utility.
● Points are easy to compose and are essential
to build other types
● A point is nothing more than a location in
space based on the xyz coordinate system
● Decompose points into their X, Y, and Z
components to build planes and axis as the
base for transformations
Curves

Curves are essentially lines, and even though the


name might not suggest it, this includes straight
lines.

A curve is a line between two points and can have


multiple parameters that affect it between start and
finish. Curves can be both closed or open loops.

There are various forms of lines, these include:


● Straight
● Polylines
● Arcs
● Circles
● Ellipses
● Nurbs Curves
Surfaces

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.

NURBS surfaces are essentially rectangular grids of control points that


affect how their form. These points are not necessarily attached to
the physical surface.

A Polysurface is multiple surfaces that are joined across an edge.

On any surface there is also a new coordinate system that can be


accessed know as the UV coordinate system. This allows for locating
exact points across the surface.

UV coordinates range between 0.0 and 1.0 in a given direction


Solids

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..

A solid is 1 or more surfaces that creates a closed boundary around a


volume. (A sphere only has 1 surface)

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

Meshes are a very prevalent geometric form. They are


computationally light and flexible alternatives to working with NURBS
forms.

A mesh is a collection of triangles and quadrilaterals the represent a


surface or solid. Like solids, meshes have vertices, edges and faces.

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

1. Connect the Integer sliders to the Sequence Nodes, notice the


Min and Max limits in the slider drop down menu
2. Connect the sequences to the Points node.
3. Change the lacing on the Point node to Cross Product
4. Change the sliders to look at how the sequence controls affect
the points.
Creating Geometry - Curve

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. Open the Curves.dyn file


2. Connect the points to the NurbsCurve node.
3. Toggle the Boolean control
4. Notice the degree field in the nurb curve and how it affects the
curve.
5. With the curve close, create a Patch Node and connect it, your
first surface!
Creating Geometry - Surfaces

Once there are points and curves, we have the beginnings of


the information that will feed into our surface calculations. For
this exercise we will use the loft Node to create a surface that
connects 3 curves along defined Vectors.

1. Open the Surface.dyn file


2. Connect the points following the layout logic.
3. Notice how a change at the point level can affect the
final surface.
4. Change the Vector of the second curve to notice how
that affects the surface.
Creating Geometry - Solids

Now we have an understanding of how to create points, curves and


surfaces, let's spend some time exploring how these can create, guide
or interact with solid shapes. Some challenges below.

1. Create a Cube
2. Create a sphere
3. Thicken a surface
4. Subtract a form from another solid
Analyzing Geometry

So you have successfully created some geometry based on a set of


inputs and now you want to query that geometry to get answers that
might relate to design, budget, location in a space or something else.

Dynamo provides the ability to analyze surfaces and topology to


provide these answers.

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

1. What is the direction of the Mesh surface called?

2. List 4 types of curves

3. What does the Patch Node do?

4. What do you call vertices, edges and faces as they relate to


solids?

5. What is the coordinate system on a surface referred to?


Session 7 + 8 - Dynamo and Revit

Dynamo operates in a standalone mode It was however,


created to interact with Revit.

While we have been working in the Dynamo workspace you may


have noticed points and surfaces appearing in the Revit window.
This is because the xyz coordinate system is directly related to
the coordinate system in the Revit workspace.

Using the core Dynamo nodes in tandem with custom Revit


ones, a user can substantially expand parametric workflows for
interoperability, documentation, analysis, and generation

Revit elements like face based modeling and adaptive


components help create the connection between the two
programs.
Selecting Revit elements

Dynamo allows us to query the Revit project, which is essentially a database of


elements and their relationships to each other.

In the Dynamo library there is a sub-category dedicated to Revit Selections.

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

With the Training File_2019.rvt open in Revit, open


Dynamo and open the SelectingInRevit.dyn file.

Work through the file and look at how the different


selection tools work and the information they bring
back into Dynamo.

These are just one way to select elements using a


live selection with the mouse pointer.

Note: When selecting elements in the Revit


window, a selection dialogue will appear
underneath the Ribbon, for multi-selections, this
will need to be ‘Finished’ to confirm the selection
Editing Revit elements

Dynamo provides the ability to access and modify


parameters in the Revit Project.

While Dynamo remainless ‘unitless’ in terms of


imperial vs metric. It does default to the open
Revit projects units.

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

The Revit nodes in Dynamo offer the ability to import elements


from generic geometries to specific category types (like walls and
floors). To demonstrate this capability we will use adaptive
components and reference the Dynamo Primer example.

Open the ARCH-Creating-BaseFile.rvt file in Revit and then the


Creating.dyn file in Dynamo.

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

Once we have the mass highlighted in the Dynamo workspace we


can begin to look at the curves that the geometry outputs.

Working through the script we can notice the following steps.

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

Now we know the process and workflow to populate trusses in a


massed shape, let’s create a Mass in Revit on the roof of the
building and replicate the process.

Try recreating a triangular extrusion over the void space of the


mass. Use reference lines and then select those lines to create a
planar mass.

Exercise:
1. Recreate the trusses over the courtyard of the Mass.
Revit Views with Dynamo

One major bottleneck in Revit production work is the production


of drawings sheets and views.

With Dynamo, you can quickly populate a drawing set based on


your view and sheet requirements.

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.

This is very powerful when working in a company with many scripts. It


also allows for the script creator to enable inputs to make the script
specific to the task.

Dynamo player allows for the following:


● A default directory for scripts
● Filtering visible scripts
● Viewing the status of current scripts
● Launching a script
● Providing input for scripts in Dynamo Player
● Editing a script in Dynamo
Additional Exercise

To further explore the Revit - Dynamo relationships, try the


following tasks:

1. Create a list of all windows and locate their origin point.

2. Create a nested list of all columns by their level.

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

1. What unit system does Dynamo use?

2. What is the selection hierarchy of Revit?

3. What options do you have for selecting Revit


elements through Dynamo?

4. If you didn’t have Dynamo experience and wanted


to run a script, what tool would you use?

5. How do you use the mouse pointer to select


multiple elements in a Revit project?
Session 9 - Determining Potential

While Dynamo is a powerful tool for creating


automations, there should be some mind paid to
when it is best to create automation scripts.

For the majority of repetitive tasks, Dynamo will be


your champion.

However, doing one-off tasks through Dynamo could


end up taking 3 times the amount of time that the
user could perform it natively in Revit.
Session 9 - Determining Potential

Within offices work environments, there will often


be common pain points in production work.

It is a good policy and process to develop a


transparent list of development items starting with
the most painful and going from there.

This will reduce the duplication effect of multiple


people working on the same task at the same time.

This way there can be a clear path to running a more


automated and efficient office.
Session 9 - Planning ahead...

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:

1. Identify the major pain points with the current workflow


2. Identify the most recurring tasks
3. Make a note of what elements are involved in these workflows and
task.
4. Determine if Adaptive Components need to be created
5. Start the basic mapping process of how a workspace should look
when creating these scripts.
Session 9 - Planning ahead...

Working in small groups, split up the identified tasks and begin looking to
create solutions using Dynamo.

These scripts can be saved and distributed at end of class to be reused,


updated or built upon in the future.
Session 10 + 11 - Creating and Implementing
Automations

You might also like