Article
Article
Article

Supercharge Your Dynamo Graph with Civil 3D Toolkit

Share this Article

Civil 3D Toolkit is a package created inside Dynamo for Civil 3D (D4C3D). Dynamo is a visual programming application that can automate tasks in Civil 3D. 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. Civil 3D Toolkit was developed to supplement the out-of-the-box nodes and provided enhancement capability that is not available in the current version. This article explains how to leverage Civil 3D Toolkit in solving basic to complex Dynamo graphs. (Looking for an introduction to Civil 3D Toolkit? Check out this presentation.)

Create a Simple and Reusable Routine

When building your Dynamo graph archives, it is very important to focus on making graphs that are scalable and reusable. Making smaller graphs that you can share with team members to learn and reuse will make Dynamo learning a lot easier.

Want to share your knowledge?
Write an article for AU

AutoCAD > Selection > Objects Types

This is one of the most common nodes that new users will want to try. On the current out-of-the-box installation, you will be able to find list of objects there. Using the Civil 3D Toolkit, you will be given more choices in the selection list.

Figure 2.1.A: Objects Types before Civil 3D Toolkit enhancement
Objects Types before Civil 3D Toolkit enhancement.

Civil 3D Toolkit > AutoCAD > DocumentExtensions

Using DocumentExtensions.AddNewTypes you can now leverage selecting more objects like Arc, CogoPoint, Featureline, Hatch and MLeader, to name a few.

Figure 2.1.B: Objects Types after adding DocumentExtensions.AddNewTypes
Objects Types after adding DocumentExtensions.AddNewTypes.

Other nodes inside DocumentExtensions also provides valuable impact to your efficiency. You can get and set the civil object styles. You can get the object handle and the object using that handle. You can also get information like coordinate system code, xrefs used and layout tabs.

Figure 2.1.B: Objects Types after adding DocumentExtensions.AddNewTypes
DocumentExtensions GetStyle and SetStyle.
Figure 2.1.D: DocumentExtensions.ObjectHandle & ObjectByHandle
DocumentExtensions ObjectHandle and ObjectByHandle.
Figure 2.1.E: DocumentExtensions.GetCoordinateSystemCode, XRefs, Layouts & DocumentStyles
DocumentExtensions.GetCoordinateSystemCode, XRefs, Layouts, and DocumentStyles.

Civil 3D Toolkit > AutoCAD > Arc

Converting Dynamo Arc geometry to Civil 3D geometry has been a challenge for many Dynamo users in the past. Using the Civil 3D Toolkit, you will be able to convert the Dynamo Arc geometry to Civil 3D.

Figure 2.2.A: Sample Arc geometry not converting to CAD using Object.ByGeometry
Sample Arc geometry not converting to CAD using Object.ByGeometry.
Figure 2.2.B: Arc geometry convert to CAD using Arc.ByGeometry (Option1)
Arc geometry converted to CAD using Arc.ByGeometry (Option1).
Figure 2.2.C: Create Arc directly to CAD using Arc.ByThreePoints (Option2)
Create Arc directly to CAD using Arc.ByThreePoints (Option2).

Instead of creating ArcByThreePoints inside Dynamo, the toolkit will allow you to build the geometry directly to CAD.

Converting Arc from CAD to Dynamo using Object.Geometry is not implemented. Using the toolkit will allow you to convert the CAD object and convert it to Arc before the Object.Geometry will be able to recognize the object. Alternatively, you can also use the Arc.Geometry which will create the Arc in Dynamo.

Figure 2.2.D: Converting CAD Arc to Dynamo Geometry
Converting CAD Arc to Dynamo geometry.

Civil 3D Toolkit > AutoCAD > Selection

Selecting an object from Civil 3D is available but only limited to selecting one object at a time. Using the toolkit, you can choose multiple objects all at once or specify more objects to add to the current selection set.

Figure 2.3: Select object and Select objects that allows multiple selections in Civil 3D
Select object and select objects that allows multiple selections in Civil 3D.

Civil 3D Toolkit > AutoCAD > Hatch

The toolkit also provides some enhancement with hatch. The Hatch.ByObject returns a hatch from an AutoCAD hatch object which allows us to get information like rotation, scale, pattern and even geometry as polycurve boundary of the hatch.

Figure 2.4.A: Selecting CAD hatch and using Hatch.ByObject to get the hatch information
Selecting CAD hatch and using Hatch.ByObject to get the hatch information.
Figure 2.4.B: Selecting CAD closed region & using Hatch.ByGeometry to assign hatch then set the color
Selecting CAD closed region and using Hatch.ByGeometry to assign hatch, then set the color.

Civil 3D Toolkit > AutoCAD > BlockReferenceExtensions

The ability to add block references has been part of our daily AutoCAD work in the past. Inserting the block to the exact location using Dynamo in a very efficient way is groundbreaking. It eliminates human error and provides a fast and accurate way of inserting a block. The Toolkit enhancement provides users the ability to create block references in CAD using Dynamo geometry.

Figure 2.5.A: BlockReferenceExtensions.ByGeometry creates a block reference from a list of geometries
BlockReferenceExtensions.ByGeometry creates a block reference from a list of geometries.
14
Swap the block definition of a block reference.
Figure 2.5.C: Assign hyperlink to a block reference and Get the insertion point, name and block objects
Assign a hyperlink to a block reference and get the insertion point, name, and block objects.
16
Get the block reference of the dynamic block.

Civil 3D Toolkit > AutoCAD > LayerExtensions

Toolkit allows you to create a new Layer by defining the input name and color.

17
Create a layer in CAD. If the layer exists, assign the color.

Civil 3D Toolkit > AutoCAD > MText

Toolkit adds more functionality for MText and has the ability to create an Mtext by specifying insertion point, text, rotation, and height of the Mtext. By default, it will use Layer 0 and Model space.

Figure 2.7: Create MText ByPointTextRotation, ByObject and ByText
Create MText ByPointTextRotation, ByObject and ByText.

 

Want more? Download the full class handout to read on.

Jowenn is an implementation consultant at Autodesk. He holds a bachelor's degree in Civil Engineering from De La Salle University and a master's degree from Ateneo De Manila University. He has over 16 years of industry experience in design and construction. He is highly skilled in Civil 3D, Dynamo, and Subassembly composer. He provides technical workflow solutions, mentoring, and consulting.