Professional Documents
Culture Documents
DYNAMO
DYNAMO
o o nn
o
cc cc c
cco
1.1. o cc o o 3 c
1.2. The interface .........................................................................................3
. v.vnn 1.3.
. v.vnn . v.vnn
Definitions ............................................................................................4
bim
bim b b imim b bim im 4
h ee
h h h ee h h ee
1.3.1. Nodes ...................................................................................................
g nn g....................................................................................................
g n n gg
g g
1.3.2. Wires
nn nn g g 5
.v.vnn . v.vnn
2. Working with Data .................................................................................... 6
. v.vnn
bbim
im b b imim b bim im 6
h ee
h
2.1.
h h ee h h ee
Data types .............................................................................................
g 2.2. n
Math n gg ......................................................................................
functions n n gg 6
nn gg n n gg
2.3.oo Working with Text String.....................................................................
cc ccoo 7
c
2.4. Working with a List ..............................................................................7
.v.vnn 2.5.
. v.vnn . v.vnn
Code Block .........................................................................................10
bbim
im 2.6. b b imim b bim im13
Custom Node ......................................................................................
h ee
h h hee h h ee
g 2.7.
n ngg............................................................................................
Functions
n n gg 15
nn
2.8.oo
gg nn g g
ccoo
cc Working with Excel............................................................................ 15
c
2.8.1. Reading data .......................................................................................16
bbim
im b b imim b bim im
3. Designing Geometry ................................................................................ 19
h ee
h hh ee h h ee
g 3.1.
n gg............................................................................................
n
Overview
n n gg 19
nngg n n gg
ccoo ccoo c
1
o nn
o o nn
o
cc cc c
. v.vnn . v. vnn . v
. vnn
b im
b im 3.2.
imim im im
Points ..................................................................................................21
b b b b
hhee 3.3. h h ee h h ee 21
Vectors ................................................................................................
g n n gg n n gg
3.4.
n ngg .................................................................................................
Curves
n n gg 22
c co
3.5.
o c co o
Surfaces ..............................................................................................23 c
3.6. Solids ..................................................................................................24
. v.vnn . v. vn n . v
. vnn
bim
bim 3.7.
imim im im
Importing Geometry ...........................................................................25
b b b b
h ee
h h hee..............................................................................
4. Interacting with Revit
h h ee 26
g n ng g n n g g
4.1.
nn gg .............................................................................................
Selection
n n gg 26
ccooEdition ................................................................................................
4.2. ccoo 29 c
4.3. Creation ..............................................................................................30
c co o c co o
4.8.2. Creating Revit Elements ....................................................................44 c
5. References ............................................................................................... 45
. v.vnn . v
. nn
v . v
. nn
v
b i
bmim b im
im
DYNAMO REPORT
b bbim
im
hhee 1. Introduction
h hee hhee
g nngg n gg
n
n ngg
1.1. What is Dynamo
n ngg
ccoois primarily a plug-in for AutodeskccRevit
Dynamo
oo and Vasari. Dynamo can c
also run as a stand-alone application with all the list and logic functionality, and with
. v
. n
v n
some
. v
. n
v
experimental geometry tools availablen using the Autodesk Shape Managernn
.v.v
bim
bim kernel.
b im
b im b b imim
h ee
h hhee to design custom computational h heedesign and
g gg a node-based Visual Programmingninterface.
Dynamo allows designers
automation processesn n gg This means
n
nngg through
nn gg
c coocan leverage computational concepts, cwithout
that a designer
coo the need to write code. In c
addition, Dynamo gives the designer the added advantage of being able to leverage
computational design workflows within the context of a BIM environment. The
. nn Nodes
v.v1.3.1. . v.vnn . v.vnn
bbim
im bbi m
i m bb i m
i m
h ee
h Nodes have input Ports
hheeon the left side and output Ports onhhetheeright side.
g n nggand program flow usually goes left tonright.
Directionality of execution
n gg
n n gg n n g g
ccoNodes
o are the objects you place and connect
a visual program.
c cootogether with Wires to form c
Nodes can represent Revit Elements like Model Lines or Reference
n n
v.vflow. You can think of them literally.v.vnasnelectrical wires that carry pulses.v.ofvnn
Wires connect between Nodes to create relationships and establish a program
.
bim
bim information from one object to thebbinext.
m
im bbimim
h ee
h hhee hhee
g n
You createngga Wire using the mouse left-clicking nonngangoutput Port and
n ng g nn gg
ccodragging
o with the mouse button held cdown,
port of another node.
coo then connect to the input c
To disconnect a Wire, left-click on the output Node and pull the Wire
.v.vnn away.
. v.vnn . v.vnn
bbim
im bbim
im bbim
im
h ee
h h ee
h h ee
h
g nngg nngg
n gg
n n gg
n
ccoo ccoo c
. nn
v.v1.3.3. . v
.vnn . v
. nn
v
bbi m
i m Ports
bbimim bbim
im
h ee
h h heeareas on Nodes, they are the receptors
h eefor Wires.
h
g Information flowsg n nggthe Ports from left to right.
Ports are the light rectangular
nngg
nn g
through
n gg
n
ccoInputs
o Ports are on the left side of the Node.
ccoo c
Outputs Ports are on the right side of the Node.
. nn
v.v1.4. . v. nn
v . v
. nn
v
b i
bmim An example
bbimim bbim
im
hhee There is a beginning h hee about how it work in Dynamo environment.
example h ee This
h
g n nga greference point by coordinates (x,y,z). nngg
n ngg
program help us create
nn gg
ccoInput
o port: x,y,z values ccoo c
Output port: a reference point
. v.vnn v.vnn
Let’s see the connectivity between them:
. .v.vnn
bim
bim bim
b im b im
b im
h ee
h h ee
h hhee
g nngg n gg
n
n gg
n nngg
ccoo ccoo c
. nn
v.vmathematical operators or functions like n
. v
. v n subtraction, multiplication .andv.vnn
addition,
i m
i
bb to…m i
division…Or having some functions
bb m
i m i m
i
like less than one another, equal to or not
bb m
equal
e e e e ee
ghh nn g ghh
nn gghh
nng g nng g
cco o cco o c
6
o nn
o o nn
o
cc cc c
.v.vn n
2.3. Working with Text String
. v.vnn . v.vnn
bbim
im bbim
imthis node take two inputs: the string,bbwhich
Here is the ChangeCase node, imimwe
h ee
h h hee
already have in the workspace. hh ee
g nngg n ngg
n ngg n ngg
ccoo ccoo c
. v.vnn For this example, let's go ahead.v.andvnnuse three inputs and we'll also drag.v.invnn
b im
b im maybe three Integer Sliders to plug
bbim mListCreate node. Or maybe in somebbicases
iinto mimwe
hhee h hee h hee
g can use Number Slider g
nn g of Integer Slider.
instead
n gg
n
n ngg nngg
ccoo ccoo c
.v.vnn v.vnn
Drawing circles and polygons depend on a list:
. . v.vnn
bbim
im bbim
im bbim
im
h ee
h h ee
h h ee
h
g nngg nngg
n gg
n n gg
n
ccoo ccoo c
.v.vnn Notice that the List.Count node has . v.vnonninput. It is being used as a function,.vso.vnn
bbim
im the List.Count node will be applied
b bim
imto every individual list one step down
b im
b im
in the
h ee
h hierarchy. The blank inputhheList.Countcorresponds
e to the list input ofhhee
g n ngg of
n ngg List.Map.
. nn
v.vDesignScript . v
. nn that offers both immediate feedback
v
is a readable and concise language
.v. nn
v
bbi m
i m i
to small bits of code and also scales
b b m
i m imim
to large and complex interactions. DesignScript
bb
h ee
h hh
also forms the backbone of theeeengine that drives most aspects of Dynamo
h hee“under the
g hood”. Because nearlyn nggof the functionality found in Dynamonnodes
all n ggand interactions
nngg nn gg
ccoo ccoo c
10
o nn
o o nn
o
cc cc c
. nn
v.vhave . v
. nn
v . v
. nn
v
b i
bmim b im
b im interactions and scripting in a fluid
b b m
im
iway.
a one-to-one relationship with the scripting language, there are unique
h ee
h h heeboth for creating and querying data. hhee
how this shorthand can be used
g nn gg n ngg
nngg nngCode
g Block Equilvalent
ccoo ccoo
Data Type Standard Dynamo
c
Numbers
.v.vnn Creating advanced ranges allows.v.vusnnto work with list of lists in a simple
. v.vnn
bbim
im fashion. In the examples below,bbiwe're
mimisolating a variable from the primary
bbim
imrange
h ee
h h herange
e of that list. h hee
g n ngg
notation, and creating another
nngg
n ngg n ngg
ccoo ccoo c
h ee
h h hee h hee
g 2.6. Custom Nodenn
gg n ngg
ngg
n n ngg
ccoo ccoo c
13
o nn
o o nn
o
cc cc c
. v.vnn The custom node environment.v.vnisndifferent from the Dynamo graph . v.vnn
b im
b im environment, but the interactionbisbifundamentally
m
im b bimim
e e e e the same. With that e e
said, let's create
ghh our first custom node. gg
nn
hh
nn g ghh
Here o
gg
nnexample that we have seen before: oonn
iso
gg
cc an
cc c
.v.vn n vvnn
Now we get started to create a custom node and it seems like a sub-program.
v.vnn
The important thing is that we have to. .indicate the exact input and output for .this
bbim
im custom node. bbimim bbimim
h ee
h hh ee hhee
g n nggNode, and creating two inputs and annoutput
ngg for the custom
n ngg
Click New\Custom
n ngg
node.
ccoo ccoo c
. nn
v.v2.8.1. . v
. vnn . v
. nn
v
b i
bmim Reading data
bbimim b im
b im
hhee Now the column datahheinean excel file is imported and assign tohahecolumn
e in the
g Revit schedule. Let’snnggto the Dynamo code as belows: nngg
n gg
n
refer
nngg
ccoo ccoo c
.v.vnn . . nn
Categories: choose a category in Revit system.
v v . v
. nn
v
bbim
im i
All Elements of Category:
b b m
i m show a list of all elements
b bimim
h ee
h hh ee
Element.GetParameterValueByName:
h hee of all
show a list of properties
g n ngg nngg
ngg in order to make a list following
elements.
n
oList.Transpose: n gagright input format.
n
o
ccFile c oo
c c
Path: specify a path for an existing excel file.
Excel.ReadFromFile: read the entire columns from a sheet.
bbim
im bbim
im bbim
im
h ee
h h ee
h h ee
h
g nngg nngg
n gg
n n gg
n
ccoo ccoo c
. v.vnn After placing rooms for all levels.vof.vnthisn project, we need to add some of these. v.vnn
b im
b im information such as Name, Number, bbimim b biarem
ima lot
hhee h hee Department…In properties palette,
h hee
there
g n nggit can be extract to schedules like Area,nPerimeter…
of things about room that gg
n
n ngg n ngg
ccoo ccoo c
.v.vnn . v
. nn
v .v. vnn
bbim
im imim imim
Here is a Dynamo diagram shows how to write data into a Excel spreadsheet.
b b b b
h ee
h hh ee
The excel file is created before running program.
h ee
h
g n n gg nngg
n ngg n gg
n
ccoo ccoo c
18
o nn
o o nn
o
cc cc c
Here o nn g g nng g
ccisothe final result: ccoo c
. nn
v.vprinciples . v
. nn
v . v
. nn
v
b i
bmim imim im
im
that we can establish as fundamentals to start building towards more
bb bb
hhee advanced applications.
h ee
h hhee
g nn gg n ngg
n ngg n n gg
ccoo ccoo c
ccoo ccoo c
.v.vnn . . nn
Geometry.Trim: removes elements of the entity closest to the pick point.
v v . v
. nn
v
bbim
im Geometry.IntersectAll:
i m
i
botherm
get the intersection of geometry for thism
b geometries. bb i i m
object
h ee
h and a collectionee
hh thicken surface into a solid. gghh
of e e
g nn gg
Surface.Thicken: nn
nn g g nng g
Solidsoo o o
3.6.
cc cc c
Solids consist of one or more Surfaces that contain volume by way of a closed
. nn . . nn
boundary that defines "in" or "out." Regardless of how many of these Surfaces there
v.vare, vv . v
. nn
v
bbi m
i m b bi m
i m b bi m
i m
they must form a "watertight" volume to be considered a Solid. Solids can be
h ee
h created by joining Surfaces e
hhorePolysurfaces together or by using operations
hhee such as
g loft, sweep, and revolve.gg
n n n n ggare also Solids.
Sphere, Cube, Cone and Cylinder primitives
Now o nn gg n ngg
ccweowant to show you two ways to make acsolid
cooin Dynamo: c
Create a solid by lofting between input cross section closed curves.
. v.vnn The three images below breakdown . v.vnnthe main categories for Revit element
. v.vnn
b im
b im selection in Dynamo. These arebbgreat
im
imtools to use in combination, and we'll
b bimim
hhee h hee h hee explore
g n ngg exercises.
some of these in the following
n ngg
n ngg n ngg
ccoo ccoo c
. nn Edition
v.v4.2. . v.vnn . v.vnn
bbim
im This exercise focuses onbbimimRevit elements without performingbbgeometric
imim
h ee
h hheenot importing Dynamo geometry here,
editing
h heejust editing
g operation in Dynamo.
n ngg
We're
nngg
n ngg project. This exercise is basic, and ntongthegmore advanced Revit
parameters in a Revit
ccoo ccoo c
29
o nn
o o nn
o
cc cc c
. nn
v.vusers, . v
. nn
v . v
. nn
v
b i
bmim imimto customize on a large scale. Thisbisbiallm
imdone
notice that these are instance parameters of a Revit element, but the same logic
b b
hhee can be applied to an array
hof
h ee
elements
h hee
g n ngg
with the "Element.SetParameterByName" node.
n ngg
n ngg n ngg
ccoo ccoo c
.v.vnn . v.vnn
Creating a straight beam: .v.vnn
bbim
im bbim
im bim
b im
h ee
h h ee
h h ee
h
g nngg nngg
n gg
n n gg
n
ccoo ccoo c
31
o nn
o o nn
o
cc cc c
. nn
v.vabove. . v.vnn . v.vnn
bbim
im bbim
im bbim
im
h ee
h h ee
h h ee
h
g nngg nngg
n gg
n n gg
n
ccoo ccoo c
. nn Unfolding Elements
v.v4.5. . v.vnn . v.vnn
bbim
im 4.5.1. Unfolding a Cuboid bbim im b bimim
h ee
h hhee h hee
g n nggbeen used as:
Some of nodes have
nngg
n ng g nngg
ccoCuboid.ByLengths:
o
length, and height.
ccooat WCS origin, with width,
create a cuboid centered
c
Topology.Faces: the faces of the Topology.
.v.vnn . v.vnn
Unfolding.UnfoldListOfFaces: method for taking a list of planar faces . v.vnn
bbim
im and unfolding them,bbim m returns an unfolding object thatbbstores
ialso imimthe
h ee
h starting and h heelocations of unfolded faces, this is usedhheforegenerating
g nng gfinal
n ng g
n n gg
labels.
n n gg
ccoo ccoo c
.v.vnn PolySurface.BySolid
. v.vnn .v.vnn
bbim
im PolySurface.Surfacesim
bb im bim
b im
h ee
h hhee
Surface.PointAtParameter h ee
h
g n ngg nngg
n ngg n gg
n
ccoo ccoo c
35
o nn
o o nn
o
cc cc c
. nn
v.vSome . v
. nn
v . v
. nn
v
b i
bmim imim
PolyCurve need to be created after that.
b b b im
b im
hhee hhee hhee
g nn gg ngg
n
n ngg n gg
n
ccoo ccoo c
Rebar.FollowingSurface
.v.vnn RebarContainer.ByCurve . v.vnn . v.vnn
bbim
im bb imim bbim
im
h ee
h
Rebar Style
hhee h ee
h
g Rebar Barg
nn g
Type
nngg
nnggHook Orientation
Rebar n gg
n
ccoRebar
o Hook Type ccoo c
4.7. Pile Placement
v.vnn nn nn
4.8.1. Creating the Surface
. . v
. v . v
. v
bbim
im i m
i
In Revit workspace, we create
bb m
two floors as belows:
bbim
im
h ee
h h hee h ee
h
g nngg nngg
n gg
n n gg
n
ccoo ccoo c
.v.vnn . . nn
Curve.EndPoint: get the end point along the curve.
v v . v
. nn
v
bbim
im im
im im
im
PolyCurve.ByJoinedCurves: make polycurve by joining curve. Flips
b b b b
h ee
h curve as needede
hh e
for connectivity.
hhee
g nn gg the total arc length of the curve. nngg
Curve.Length:
n ngg
Geometry.Translate: translate any given nn
gg
ccodisplacements
o o o geometry by the given
in the x,y,z directions. c c c
.v.vnn . v
.vnn . v
. nn
v
bbim
im imim
User can control the shape of a Mass by change some value above:
bb bbim
im
h ee
h h hee hhee
g n ngg nn gg
n ngg nngg
ccoo ccoo c
.v.vnn . v.vnn
with a collection of Arcs and Lines.
. v.vnn
bbim
im i m
i m
Floor.ByOutlineTypeAndLevel:
bb bb i m
i
create a Revit Floor given it’s m
curve
h ee
h hhe e
outline and level.
hh e e
g nn gg nn gg
nn g g nng g
o
cc o ccoo c
.v.vnn . v
. nn
v .v. nn
v
bbim
im i m
i
To create the level, we use the
b b m
node named Level.ByElevation.
bim
b im
h ee
h h ee
h h ee
h
g n ngg nn gg
n ngg nngg
ccoo ccoo c
44
o nn
o o nn
o
cc cc c