0% found this document useful (0 votes)
798 views

Dynamo in Civil 3D Introduction - Unlocking The Mystery of Scripting

This document provides an introduction to using Dynamo for Civil 3D (D4C3D) for automating design tasks. It discusses the benefits of D4C3D such as reducing repetitive tasks and improving efficiency. Basic concepts are explained such as nodes, wires, and code blocks. Examples of tasks that can be automated using D4C3D include importing/exporting Excel data, querying parameters, and creating geometry. The document encourages learning through exploring sample files and emphasizes that practice is important for mastering D4C3D.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
798 views

Dynamo in Civil 3D Introduction - Unlocking The Mystery of Scripting

This document provides an introduction to using Dynamo for Civil 3D (D4C3D) for automating design tasks. It discusses the benefits of D4C3D such as reducing repetitive tasks and improving efficiency. Basic concepts are explained such as nodes, wires, and code blocks. Examples of tasks that can be automated using D4C3D include importing/exporting Excel data, querying parameters, and creating geometry. The document encourages learning through exploring sample files and emphasizes that practice is important for mastering D4C3D.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

CES319333

Dynamo in Civil 3D Introduction – Unlocking the


mystery of scripting
Jowenn S. Lua
Arcadis

Andrew Milford
Autodesk

Learning Objectives
• Understand the basic uses of AutoCAD and Civil3D dynamo nodes
• Learn how to import / export data from Excel using dynamo
• Learn how to leverage basic nodes in automating your design changes
• Create reusable graphs to accelerate your design process

Description
Delivering an infrastructure project is becoming more time consuming as we are now required to
provide not only detailed models, but also more information. Modifying and reviewing designs
and making all dependent geometry update to a new location with a click of a button is a game
changer. In this class, you will learn the basics of AutoCAD and Civil 3D Dynamo nodes and
how you can leverage Dynamo graphs in automating tedious tasks.

Speaker(s)
Jowenn Lua is a Road Design Digital Engineering Systems Specialist for
Arcadis. He holds a B.S. Civil Engineering degree from De La Salle University
and MBA degree from Ateneo De Manila University. He is a member of the
2016 Autodesk Gunslinger in Australia and participated in the ‘2018 Civil
Infrastructure Inside the Factory’ held in Potsdam, Germany. In February
2019, he became a member of Autodesk Expert Elite. He has over 16 years
industry experience in design and construction. He was previously working as
the Lead Civil 3D designer in the Sydney Metro and is one of the key persons
who developed the project’s Civil 3D system, template, plan production and tool palette
pushout. He is highly skilled in Civil 3D & subassembly composer and provides mentoring and
solutions to the team.

Page 1
Andrew Milford is a Senior Implementation Consultant for Autodesk
and is responsible for post-sales technical and business consulting to
ensure customers achieve successful adoption of Autodesk's
Infrastructure Solutions across the Asia/Pacific region. Prior to joining
Autodesk, Andrew gained over 25 years of design experience in the
civil infrastructure industry, working as a geometric road designer for
large consulting companies such as SKM/Jacobs, Arcadis, and
AECOM. Andrew’s experience extends from designing large highways,
tunnels, and interchanges down to smaller subdivision work using a variety of different design
and drafting software packages. He is an AutoCAD Civil 3D Certified Professional and loves
diving deep into AutoCAD Civil 3D software to develop and automate processes through scripts,
AutoLISP , .NET API C# and VB and Python.

Page 2
Introduction
This class will demonstrate real world scenarios where you can leverage the use of Dynamo
graphs in your design workflow. You will gain some basic knowledge in using Dynamo and will
equip you with tips and tricks to help you learn faster.

Dynamo for Civil 3D (D4C3D)


Dynamo for Civil 3D is a visual programming application that can automate tasks in Civil 3D.
This was introduced in Civil 3D 2020 as a separate add-on installation. It is an open sourced
graphical tool for design and documentation. It is a visual interface used to create logical flow of
routines and used to manipulate data and generate geometry.

Where to get the D4C3D?


You can download this via Manage.autodesk.com or via Autodesk Desktop App.

or download and Install from your Autodesk account subscription.

Where to find D4C3D?


• You need to have a dwg open before you can open D4C3D.
• In Civil 3D, you can find this in Manage Tab > Visual Programming Panel > Dynamo

Page 3
Why use D4C3D?
• Remove repetitive tasks & create automation
• Improve efficiency & collaboration
• Re-use graph from project to project

What is the benefit of using D4C3D?


• Design workflow automation
• Improved quality control
• Reduce man hours & cost effective

Where do I start?
• D4C3D start-up interface will look like this. You can learn from reference and start a new
file or open an existing file.

What is the extension file used?


• Civil 3D = .DWG
• Dynamo = .DYN

Page 4
D4C3D Interface
• Opening a new file will give you a blank Dynamo interface.

• You can expand the Library to get a node or type in the search tab to look for a node.

Page 5
Basic uses of AutoCAD and Civil 3D Dynamo nodes
Understanding the basic uses of D4C3D nodes are very important and will require a lot of
reading, practice and testing of sample cases. Sample case files are available, and it is located
in the following link:
C:\ProgramData\Autodesk\C3D 2020\Dynamo\Samples
C:\ProgramData\Autodesk\C3D 2020\Dynamo\API Samples

These sample cases were explained in the Autodesk knowledge network. It is highly
recommended to open them and check them out. <D4C3D Case Link>

It is also important to be open-minded when learning D4C3D as there are so many ways to
achieve the same outcome. You may encounter a better workflow as time goes by as it is part of
the learning journey. What is important is that you try to test D4C3D and see how you can
automate some of the repetitive or complex tasks that you normally do.

D4C3D will give you built-in nodes that can do specific functions and they are categorized in the
Library. The first two in the Library are AutoCAD and Civil 3D Nodes and the rest is part of the
Dynamo core which is common to other software that uses Dynamo like Revit.

Dynamo nodes and wires


Nodes perform a specific function or process in Dynamo. You can connect each node using a
wire connector to form a visual flow of task like a flow chart. Sample outcome you can achieve
by using Dynamo is to manipulate data, import / export data to excel, query and update
parameter, create simple or complex geometry and many more.

1. Node Name – Mostly uses “Category.Name”


2. Input Port - Can only receive one wire from output port
3. Output Port – Can supply multiple input port
4. Node Main body - Right click here to see options for this node
5. Lacing option – Choose from Auto, Shortest, Longest, Cross Product
6. Wires connector – Connect nodes together and establish the flow of our visual program

Page 6
Node default value & result preview
• Hover your mouse to the input port to display tool tip for variable type and default value
• Hover your mouse to AUTO will allow you to pin and unpin the result preview

Types of nodes

Create Creating / constructing something e.g. creating object or geometry


Action Doing some action e.g. delete object, set value or doing math functions
Query Getting some value or parameter e.g. Get radius of a circle

Dynamo Core Nodes


The core nodes are basic functions that run inside the Dynamo. It includes Dictionary, Display,
Geometry, ImportExport, Input, List, Math, Script and String. Recommended ways to learn the
Dynamo core nodes is to visit the following link:
https:\\DynamoBIM.org
https:\\DynamoPrimer.com
https:\\DynamoNodes.com
https:\\Dictionary.dynamobim.com

In this class, we will focus more in highlighting AutoCAD and Civil 3D nodes, but we will use
some of the Dynamo core nodes that will help us achieve a certain task.

Code Blocks
Code blocks are text interface that can be used as numbers, strings, formula, list, variable and
other available data types. Code block allows design script code to be authored directly. Double
click your mouse in the workspace / canvas to create a code block.

Page 7
Code block as Boolean expression
• A == B equality
• A != B inequality
• A < B less than
• A <= B less than or equal to
• A > B greater than
• A >= B greater than or equal to
• && logical AND (true only if all the arguments are true)
• || logical OR (true if at least one argument is true)

Page 8
Watch Node
It is essential to see the output or result of your design graphs. Using Watch Nodes will allow
you to visualize design graph progress and result.

Design & Python Script


For new users in Dynamo, it is important to know that there is an advance method of creating
your Dynamo graphs. As you gain more knowledge in Dynamo, you will be encountering some
design script or python script. You can learn this further in the future. As a guide, we will provide
some sample Design script and Python script in the sample data sets.

Number Ranges
In Dynamo, you will encounter a lot of cases where you want to create different types of
continuous or ranges of numbers. Understanding the power of design script inside a code block
will come very handy in your design graph creation.

Page 9
Sample:
• Start..End; a range of numbers
• Start..End..Step; a range of numbers with step
• Start..End..~Step; a range with an approximate step
• Start..End..#Items; a range of a given number of items
• Start..#Items..Step; a sequence with a number of items and a step

List
In programming world, list is built on top of array. In Dynamo, it is a collection of elements or
items in order. The first item is always an index “0” (Zero). You can have list of a single item, list
of multiple items, list of lists, or have a list of list of list. You can mix any list and can be useful if
you know how to get them by their indexes.

Sample:
• List[a]; returns the item in the list at index “a”
• List[-a]; return the item starting from end of the list till “a”, List[-1] gives end of list
• List[a][b]; returns the item in sublist at index “b” of list “a”, If [-a][b] will start from end
• List[a..b]; returns the item in the list between the indexes “a” to “b”
• List[[a,b,c]]; returns the item in the list respectively at location “a”, “b” and “c”
• [a,b,c]; declare a list in code blocks

Page 10
AutoCAD Nodes & Civil 3D Nodes
These are nodes specifically created for automating AutoCAD and Civil 3D
tasks through Dynamo. For D4C3D release 2020, it has Documents, Objects,
Selection under the AutoCAD library and CivilObjects, Selection under the
Civil 3D library.

Installing release 2020.1 will give you additional dynamo nodes. To name a
few, it now includes PropertySet, CogoPoints, Surfaces, Profiles nodes.

One of the most important nodes in the AutoCAD library that will be used
often is the “Document.Current” node. This is needed to link the current opened drawing to the
current opened dynamo file.

Connecting a “Document.ModelSpace” to “Document.Current” will allow you to specify that you


want to use the current document and current model space in Dynamo.

Page 11
ACAD object transfer
For object, the two most important nodes to remember are Object.Geometry and
Object.ByGeometry.

The Object.Geometry allows you to convert an object from CAD to Dynamo geometry.

Sample:
AutoCAD > Objects > Object > Geometry

The Object.ByGeometry allows you to convert Dynamo to CAD geometry.

Sample:
AutoCAD > Objects > Object > ByGeometry

Page 12
ACAD object selection
One of the basic object selections to use is ‘selecting by object’. Although you can only select
one object at a time, it has the ability to pick from screen which object to use. Alternatively, you
can also select object by its type or by its layer.

Sample:
AutoCAD > Selection > Select Object
AutoCAD > Selection > Objects Types
AutoCAD > Selection > All Objects of Type
AutoCAD > Selection > All Objects on Layer

Advance method of object selection is by using the ObjectsByProperty.

Sample:
AutoCAD > Selection > ObjectsByProperty
AutoCAD > Selection > Value Operators

Page 13
Import / Export data from Excel using Dynamo
Data manipulation is one of the strengths of using Dynamo. The ability to import and export to
excel is very important especially when you want to import raw data and build geometry then do
some calculations and export it back with a user defined report format.

Import data from Excel (Excel to Dynamo)


1. Browse the file using “File Path” node
2. Connect the “File Path” to “File.FromPath" node to get the actual file
3. Connect the file to “Excel.ReadFromFile” node
4. Define Sheet name to use as string
5. Assign Boolean decision True / False or accept default value

Data Manipulation Tips, commonly use nodes are the following:


List Create – Make a new list out of the given input
List.Transpose – Swap rows and columns in a list of lists
List.GetItemAtIndex – Returns an item from a list that’s located at the specified index
List.DropItems – Removes the number of items from start of the list
List.Flatten – Flattens a nested list of lists by a certain amount

Refer to Autodesk Dynamo sample file:


Path: C:\ProgramData\Autodesk\C3D 2020\Dynamo\Samples\en-US\ImportExport\
File: ImportExport_Excel to Dynamo.dyn

Page 14
Export data to Excel (Dynamo to Excel)
1. Browse the file using “File Path” node
2. Connect the “File Path” to “Excel.ReadFromFile” node to get the actual file
3. Assign a sheet name to write data to
4. Assign number for start Row and Column
5. Connect the lists to data to get the information needed
6. Assign Boolean decision True / False or accept default value

Data Manipulation Tips, commonly use nodes are the following:


List.Join – Concatenates all given lists into a single list
List.Chop – Chop a list into a set of consecutive sublists with specified lengths
List.AddItemToFront – Adds an item to the beginning of a list
List.AddItemToEnd – Adds an item to the end of a list
List.FilterByBoolMask – Filters a sequence by indices in a list of Booleans
SortIndexByValue – Sort the list by the item and return their indices

Refer to Autodesk Dynamo sample file:


Path: C:\ProgramData\Autodesk\C3D 2020\Dynamo\Samples\en-US\ImportExport\
File: ImportExport_Data To Excel.dyn

Page 15
Import data from CSV (CSV to Dynamo)
Option 1
1. Browse the file using “File Path” node
2. Connect the “File Path” to “File.FromPath" node to get the actual file
3. Connect the file to “FileSystem.ReadText” node
4. Manipulate data by “String.Split” and “String.ToNumber” from String nodes
5. Process data by List and Geometry nodes
Option 2
1. Browse the file using “File Path” node
2. Connect the File Path to “Data.ImportCSV” node
3. Assign Boolean decision True / False or accept default value

Refer to Autodesk Dynamo sample file:


Path: C:\ProgramData\Autodesk\C3D 2020\Dynamo\Samples\en-US\ImportExport\
File: ImportExport_CSV to Stuff.dyn

Better approach would be to use Data.ImportCSV instead of using FileSystem.ReadText

Page 16
From Option 1 graph

To improved Option 2 graph

Export data to CSV (Dynamo to CSV)


1. Browse the file using “File Path” node
2. Connect the “File Path” to “Data.ExportCSV” node to get the actual file
3. Connect the lists to data to get the information needed

Page 17
Leverage basic nodes in automating your design
Out of the box (OOTB) nodes are very powerful and can usually be
found in every graph. The most common basic nodes are found in the
Geometry, List and Math libraries.

Exercise 1 - Object placement with Excel


• AU2019_01_Road Signs From Excel.dyn

Excel has always been a popular tool throughout the engineering


industry when it comes to automation as it is easy to manage and helps
drive all the metadata that is to be included in a model.

The following example demonstrates how to use an Excel file to drive data creation within Civil
3D. Conversely, Excel files can be used to extract data from the design model for reporting
purposes.

1. Sketch an overview workflow on how you will automate the process. The is process can be
done on a computer or even mapped out on a whiteboard.

Page 18
2. Block References in Dynamo can be either 2D, 3D or Multi-View blocks. To prepare a
Multi-View block, a 2D and 3D block are required.

For more information about Multi-View Blocks refer to the link below:
https://knowledge.autodesk.com/support/civil-3d/learn-
explore/caas/CloudHelp/cloudhelp/2017/ENU/Civil3D-UserGuide/files/GUID-8EC3AE29-
516A-445F-A134-D939B30C2E41-htm.html

This example uses a simple 3D block which has been created in Inventor and exported
as a DWG file.

To make full use of these blocks in later exercise, The light pole has been modelled as
an ‘Assembly’, which is built up of three ‘parts’, including the light head, pole and footing.
It is the footing that will be used as part of a clash detection and space proofing exercise.

Page 19
Page 20
3. An Excel file is setup to with some parameters in which to create the data that Dynamo
will use to lace the Civil 3D objects. Columns include:
• Sign Type – This is the name of the AutoCAD block reference
• Control Line – The alignment against which the block is to be placed
• Chainage – the chainage (or station) where the object is to be placed
• Offset – Distance from the alignment
• Side – use LHS or RHS to determine which side of the alignment to place the
object

Page 21
4. Setup the Dynamo graph that uses the basic nodes for AutoCAD and Civil 3D.

5. Final output of the models.

Page 22
Exercise 2 - Creating Corridor Solids
• AU2019_02_Corridor Solids.dyn

In this exercise, the aim is to extract information from the Civil 3D model to create a Dynamo
version of the corridor solid. This Dynamo solid will be used in the next exercise as part of a
space proofing and clash detection exercise.

1. Before beginning the Dynamo graph, it is required to setup the Civil 3D drawing to
prepare the model for export.
This involves setting up consistent point, link and shape codes that will be used across
multiple models.

Page 23
2. Like all examples in this document, start the Dynamo graph with a reference to the
current document

3. Extract the corridor from the Civil 3D model


The graph snippet below is a useful setup as it takes a list input (corridors in this
instance). The Name is extracted from each corridor in the document, which is the
checked against a keyword ’Barriers’.
The ‘String.Contains’ node checks the search string against items in a list and returns
either a True or False value.
This True/False list is passed into a List.FilterByBoolMask node, which will split the
Corridor list based on the results of the True/False list.
The result from the ‘in’ output slot is a corridor (or corridors) that contain the word
‘Barriers’

4. Get the Corridor Baseline Shapes.


• PointsByLinkCodeAtNearestStation
• PointsByPointCodeAtNearestStation
• PointsByShapeCodeAtNearestStation

These nodes will extract a list of points for each frequency


along a corridor’s baseline, covering a range of stations.
In this example, the ‘Barrier’ shape code points are
extracted as Dynamo Points

Page 24
5. Create a Dynamo solid from the baseline footing shape.
Create a simple Dynamo polygon object from each list of points. Polygons are useful in
this situation as they are a closed-object by default.
It is also viable to use a PolyCurve, however an additional node is required to close the
PolyCurve before lofting.

6. OPTIONAL – Export the Dynamo solid footings to AutoCAD Civil 3D


If the solid is required in AutoCAD, use the AutoCAD > Objects > Object >
ByGeometry node

Page 25
Create reusable graphs to accelerate your design process
Exercise 3 - Space Proofing and Clash Detection
• AU2019_03_Space Proofing.dyn

In this exercise, the Dynamo Corridor solid information produced in Exercise 2 will be used to
clash against the road furniture items created in Exercise 1
Almost half of this graph is copied from the previous exercise, where the creation of footing
solids from a barrier corridor was undertaken.
The resulting output will be a series of geometric spheres at the clash locations (in Dynamo and
Civil 3D)

1. The first group in this graph will import the same Excel data that was used in Exercise 1
(Object placement). The aim of this import is to get a list of all the blocks that have been
placed in the Civil 3D model. This is achieved with the ImportExcel node and the header
is remove with the List.Deconstruct.Finally, the unique items from the list are extracted
using a List.UniqueItems node

Figure 1: Get the unique items in a list with List.UniqueItems

Page 26
2. The bottom half of the graph uses the current document to extract the corridor and then
get the corridor baseline shapes from the barrier footing.
Dynamo solids are created using a Solid.ByLoft, which is identical to the process used in
Exercise 2

Figure 2: Get Corridor, Footing Shapes and Create Dynamo Solids

Page 27
Working with large geometry (i.e. far from 0,0) can produce warnings in Dynamo, similar to the
image below-left. The node highlights in yellow and a message stating …”Geometry Working
Range” appears. In a bubble above the node. This is due to the data being far from the origin
and does not affect the way Dynamo calculated the information. This will, however, affect the
display of geometry, which may become faceted and look rather ‘odd’.
There is an option to change the Geometry Working Range through the Settings > Geometry
Scaling option. By default, Dynamo uses the ‘Medium’ setting
It is advised not to change this setting, and to leave it at ‘Medium’
Changing the range to a setting of ‘Large’ or ‘Extra large’ will result in Dynamo recalculating the
geometry differently and will produce some unexpected results in geometry.
This is the reason why the node contains the Geometry.Translate set of nodes, to temporarily
translate the geometry close to origin to produce a higher-quality better visual output,

Figure 3: Geometry Working Range warning and Geometry Scaling

Figure 4; Geometry Working Range dialog

Page 28
3. Extract the Block Reference from AutoCAD
To provide a set of objects for the footing to clash against, it is necessary to extract the
already-inserted block information from the Civil 3D drawing.
To do this, extract All Objects of Type (in this case, a Block Reference), and test the
block name against all the blocks in Excel file.
This will return a True/False list, which will then create a filtered list of items and their
corresponding CoordinateSystem/setout location.

4. With the block objects identified for clash, extract the information from the block. This is
achieved with the Block.Objects node. This will extract the individual objects of a block.
In this case, a list of solids which is the converted to Dynamo geometry using the
Object.ByGeometry node.
As the clash detection will take place underground, there is no need to consider
elements above the surface. In this case, each object has a footing, which is the lowest
item in the block element list.
To optimise the performance of the graph and remove unwanted clash checks, extract
only the block item at the lowest elevation (or ‘Z’ value). This is done by:
• Get all Dynamo geometry solids (Object.Geometry)
• Get the centroid of all Dynamo solids (Solid.Centroid)
• Get the Z point of each centroid (Point.Z)
• Sort the items in each sublist by the centroid ‘Z’ value (List.SortByKey)
• With each list sorted by ‘Z’, take only the first item in each sublist
(List.GetItemAtIndex)

Figure 5: Extract only footing geometry using sorting

Page 29
5. Using the Geometry.Intersect, clash the two groups of items against each other.
Ensure to use ‘Cross Product’ lacing to ensure every item in each list is checked against
the other.
Once the clash is complete, create Dynamo spheres to visualise the clash points
Optional: Recreate the clash spheres in Civil 3D

Figure 6: Dynamo to Civil 3D

Page 30
Exercise 4 - Sight Line Analysis
• AU2019_04_Sight Lines from Excel.dyn

In this final exercise, we will explore the Civil 3D surface nodes to create a series of sight-line
analyses, all based on values provided through an Excel spreadsheet. Finally, the results of
these analyses will be displayed in different colours in Dynamo and AutoCAD.
This example extends the current Civil 3D Sight Analysis in that users are able to plot multiple
analyses within a single graph.

1. The first step is to setup and import an Excel file, containing information such as the
following
• Alignment
• Offset
• Side
• Eye height
• Object height
• Sight Distance
• Check Interval
These values will provide all the information required to create a successful sight line
analysis. Each row in Excel equates to one sight line analysis.

2. Extract Civil 3D alignments from Excel.


The Civil 3D node Selection.AlignmentByName takes Excel alignment value and
extracts the Civil 3D alignment. From this, the Start and End station values are used to
create the require list of analysis points.

3. Extract the analysis surface from Civil 3D


The group of nodes below uses a similar layout to the selection of corridors, in that the
surfaces’ name is compared against keyword, and a List.FilterbyBoolMask is used to
filter only those surfaces that pass the string filter. Note the TinSurface.Triangles node
is used in this instance only as a Dynamo visual reference. The remainder of the graph
uses the actual Civil 3D surface for its calculations

Page 31
Figure 7: Extract the Final surface from Civil 3D

4. Generate Eye/target points


Using the Start and End station values extracted from Step 2 and the Excel values, point
are calculated adjacent to the designated alignment control.
It is necessary to use the direction of the offset (LHS/RHS) to determine whether to
setup the point list to run from start to end OR from end to start. In both cases,
consideration should be given to understand the starting and ending stations along the
sight line.
In the image below, the list shortcuts determine the eye and target points
i.e. start..end – dist..inte uses the following variables
• start = start station
• end = end station
• dist = sight distance
• inte = analysis interval
and creates a list that begins at the alignment Start Station, finishes at the End Station
less the sight distance value, with a step of the analysis interval.

Figure 8: Setting up Eye and target points

Once the points have been placed at the horizontal locations, the surface is used to
extract the relevant elevation transforms applied to each eye/target point.

Page 32
5. Create sight lines and surface intersection points
At each sight line a Coordinate System is located the eye point, with the coordinate
systems’ ‘Y’ vector pointing towards the target.
6. The Surface.IntersectionPoints is used to project a vector on the coordinate system. If
no intersection is detected, a null value is returned. In this instance, the null value is
replaced by an extremely large value

Figure 9: Coordinate System vector on the sight line

7. Check the sight distance against the vector intersection point.


Finally, a simple test is conducted to determine whether the allowable sight distance is
greater than the calculated surface intersection distance. If the calculated distance is
greater, then the sight line is OK and is drawn in Dynamo with a green line.
Otherwise the line is drawn in red to indicates a fail condition.

Figure 10: Visual output of sight line analysis

Page 33
Bonus Information
Generating geometry from Dynamo and exporting it back to Civil 3D is very useful. It is also
important to know how to leverage the property sets in Civil 3D. It is highly recommended for
you to check our AU 2018 class: CI225967 – Using Automation in Civil 3D for Construction
Documentation and Exports. In pages 43 onwards you can see detailed guidance on how to
create property sets and how to use ‘STYLEMANAGE’ via command line.

Another strength of using D4C3D is the ability to automate the information in your property set
and to add rich meta data to your civil objects.

‘AECPSDAUTOATTACH’ variable turn on / off to auto attach the property set.

Dynamo for Civil 3D – Sample Case with Property Set Automation


Now that you’ve learned the basics, let us test what we’ve learned and see Dynamo in
action. Let’s try to use different types of nodes and connect each small re-usable graph
to get useful information between list of alignments against list of curves.

Sample: Query Polyline vs Alignment

1. Sketch a diagram of what you want to automate.


• Data we have, list of alignments, lines or polylines
• Outcome needed, find the nearest alignment closest to the end points of each lines
and report station and offset and add meta data to property sets. Create a csv export
of all the meta data.

Page 34
2. Create an overview workflow on how you will do the process.

3. Prepare a property set data for line and polyline via ‘STYLEMANAGE’. (Format, List, Set)

Page 35
• Current Limitations using Object.UpdateProperty in Dynamo

• Effect of current Limitations we convert the type to Text

Page 36
4. Setup Dynamo graph that uses the nodes from Core, AutoCAD and Civil 3D.

(Sample DYN files to be provided after AU)

5. Sample outcome – All dynamic to geometry and will update everything below.

Page 37
Bonus Class Dynamo Files
As you use Dynamo on a regular basis, you will see pattern of some basic nodes that you keep
on using. It is important to remember that creating small reusable graph is the key to
successfully implementing a good design workflow. If you focus on building smaller and
manageable graph that can easily be understood, properly documented and being shared to the
team, then it will help boost the productivity of the team simply because they can always grab
smaller graph and create a more complex custom made graph.

Sample:

Creating Helper Template (.DYF)


In Dynamo, you can only open one graph at a time. You can leverage creating a custom node to
save all your reusable graph then open this and grab any useful graph that you may need.

You can create a helper template that have all the basic nodes that you will use again and
again. You can also create a python collection that you can refer anytime without closing the
current dynamo file opened.

Sample:

Page 38
Reference

Recommended links for learning:


https:\\DynamoBIM.org
https:\\DynamoPrimer.com
https:\\DynamoNodes.com
https:\\Dictionary.dynamobim.com

Autodesk Infrastructure You tube channel


Autodesk University Classes

a. CI123653 – AutoCAD Civil 3D and Subassembly Composer – Real-World-Practice Tips


and Tricks
b. CI10903 – Ramp It Up – Advance Corridor Design in AutoCAD Civil 3D
c. CI225967 – Using Automation in Civil 3D for Construction Documentation and Exports
d. CES226095 – Civil 3D Data Mining with Dynamo

Autodesk Knowledge Network

a. Guide Link for Multi-View Blocks


https://knowledge.autodesk.com/support/civil-3d/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/Civil3D-
UserGuide/files/GUID-8EC3AE29-516A-445F-A134-D939B30C2E41-htm.html

Page 39
Appendix 1 – Shortcut Key
Shortcut Key Description Image
Ctrl+B Swap background code blocks
and 3d drawings (vice versa)

Ctrl+W Add new note

Mouse left click 2x Double clicking the accept button


(Left click) of your mouse will
create a Code Block

Ctrl+Z Undo Common Shortcut keys


Ctrl+Y Redo
Ctrl+C Copy
Ctrl+V Paste
Ctrl+A Select All
Ctrl+G Create Group nodes Grouping shortcut keys
Ctrl+U Ungroup nodes
Ctrl+D Create Custom Node
Ctrl + Shift + Up Show console

Ctrl + L Clean up Node layout

Ctrl + = (Mouse wheel up) Zoom In


Ctrl + - (Mouse wheel in) Zoom Out
Ctrl + Alt + Arrow key Pan graph
(Mouse wheel press) + move Pan graph / Pan workspace
mouse
Right click mouse + move Orbit
mouse
Hold ESC key Ability to zoom in and out
Remove hold of ESC key Back to normal view
Select nodes press Ctrl then Copy nodes using Ctrl key
move mouse

Page 40
Appendix 2 – AutoCAD 2020 vs 2020.1

Page 41
Appendix 3 – Civil 3D 2020 vs 2020.1

Page 42
Acknowledgement

Learning Dynamo for Civil 3D requires lots of research, reading and testing. I would like to say
thanks to Brett Burling (Arcadis) for support in API, Dynamo and D4C3D custom tool
development. Also, we have a very strong support from Autodesk and would like to say special
thank you to Jacob Small and Frank Huang for their technical advices.

Page 43

You might also like