When I first saw Dynamo running inside Civil 3D, I was sitting in the back row of a user group meeting, and a young designer at the front was demonstrating a graph that created fourteen alignments from a spreadsheet of coordinates, drew a profile for each, and labeled everything, while she talked. It took about forty seconds. I had run a team of CAD technicians for years, and I knew exactly how long that task took by hand, because I had scheduled it: a full day, for two people, with a better-than-even chance of one transposed digit. I leaned over to the colleague next to me and said, quietly, “That is going to change what we hire for.”
It did, though not in the way I expected. What changed was not the number of technicians. It was the kind of conversation they could have with the software. Until then, automation in Civil 3D belonged to people who could write code in the .NET API, and most designers couldn’t. Dynamo opened a second door: visual programming, in which you assemble a workflow by connecting nodes with wires, and a designer who understands the task can build a tool for it. Behind that door, and still available for those who need it, is the Civil 3D .NET API, the full, programmatic access to alignments, surfaces, parcels, pipe networks and every other civil object. Between them, the two cover most of what a civil design office, and the GIS teams that depend on it, will ever want to automate.
In this guide I’ll explain what Dynamo for Civil 3D is, what the API gives you, how to choose between them (and the other tools in this series), show working examples at both levels, explain how GIS data and Civil 3D objects can be connected by automation, and, from the CAD manager’s chair, how to govern what people build so that the clever graph of today does not become the mystery routine of next year. It is part of our Autodesk series. For the program, see Civil 3D for GIS Users: Beginner’s Guide, for the lower rungs of automation, Automating AutoCAD Map 3D: Scripts, AutoLISP and the .NET API, and for batch running, Batch Processing DWG Files: Core Console, Scripts and FME.
A note on facts: Dynamo, its packages, and the Civil 3D API change with each release, and I cannot run Autodesk software in this environment. The Python helper code in this guide was tested separately. The Dynamo and Civil 3D examples are patterns based on long-standing interfaces, to be verified in your version, against Autodesk’s current documentation and the documentation of any package you use.

What Dynamo Is
Dynamo is a visual programming environment, originally created for building design (in Revit), that is also available inside Civil 3D. Instead of writing lines of code, you place nodes, each of which does one thing (read a file, create a point, get the length of an alignment, add two numbers), and connect their outputs to the inputs of other nodes with wires. The result is a graph that you can run, edit and share. In Civil 3D, Dynamo can reach the drawing’s civil objects through nodes provided by Autodesk and by community packages.
Why it works for designers
- You see the logic. A graph reads like a flow diagram.
- You can run it step by step, and see the result at each node.
- No compiling, no project setup.
- A large library of nodes, for lists, math, geometry, files, Excel and more.
- Packages from Autodesk and the community add Civil 3D-specific nodes (for example, creating and querying alignments, profiles, surfaces and pipe networks). Names and capabilities vary, so check what your version offers.
- Python nodes: when a node doesn’t exist, you can drop in a Python script node and write the missing logic. This makes Dynamo a bridge between visual and text programming.
- Easy to share: a graph is a file.
What it’s good for
- Creating objects in bulk from data: points, alignments, profiles, parcels and labels, from spreadsheets, CSV files or GIS exports.
- Reading objects and writing reports: alignment lengths and stations, parcel areas, pipe sizes and inverts, surface elevations at given locations.
- Editing in bulk: applying styles, changing names, setting properties on many objects.
- Quality checks: testing rules across objects and listing exceptions.
- Parametric exploration: varying a parameter (a curve radius, a lot width) and seeing the result.
- Exchanging data with Excel and other systems.
Where it struggles
- Large, complex logic becomes a tangle of wires that nobody can read (“spaghetti graphs”).
- Version fragility: nodes and packages change, and graphs can break after an upgrade.
- Performance on very large datasets.
- Limited control of the user interface and error handling.
- Reliance on community packages, which may not be maintained.
- Not suitable for headless batch use in the way that .NET tools in the Core Console are.
What the Civil 3D API Gives You
The Civil 3D .NET API is a set of libraries that expose Civil 3D’s object model to programs written in C# or VB.NET, on top of the AutoCAD .NET API. With it you can:
- Enumerate and read all the civil objects in a drawing: alignments, profiles, surfaces, parcels, sites, corridors, pipe networks and structures, feature lines, survey data and more.
- Create and modify many of them.
- Convert between coordinates and stations and offsets along alignments.
- Query surfaces for elevations, slopes and volumes.
- Work with styles and labels.
- Build custom commands and user interfaces.
- Run in the Core Console, headless, for batch jobs. See Batch Processing DWG Files: Core Console, Scripts and FME.
The API is the foundation that Dynamo’s nodes and many third-party tools use. If a task is beyond Dynamo, the API is where you go.
The shape of a Civil 3D program
A Civil 3D tool is an AutoCAD .NET tool that also references the Civil assemblies, and obtains the Civil document that holds the civil objects.
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using Autodesk.Civil.ApplicationServices;
using Autodesk.Civil.DatabaseServices;
[assembly: CommandClass(typeof(OfficeCivil.Commands))]
namespace OfficeCivil
{
public class Commands
{
[CommandMethod("LISTALIGNMENTS")]
public void ListAlignments()
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
CivilDocument cdoc = CivilApplication.ActiveDocument;
Editor ed = doc.Editor;
using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
{
foreach (ObjectId id in cdoc.GetAlignmentIds())
{
Alignment al = (Alignment)tr.GetObject(id, OpenMode.ForRead);
ed.WriteMessage($"\n{al.Name}: {al.StartingStation:F2} to {al.EndingStation:F2}, length {al.Length:F2}");
}
tr.Commit();
}
}
}
}The pattern is the one from the AutoCAD guide, plus the Civil document, which gives you the collections of civil objects by type. Here it lists every alignment with its stations and length. (Check the namespaces, class and property names in your version’s documentation.)
Example: sample a surface along an alignment
A task that designers and GIS people ask for constantly: ground elevations at regular stations along a route, written to a file, for use in a GIS or a spreadsheet.
[CommandMethod("SAMPLEPROFILE")]
public void SampleProfile()
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
CivilDocument cdoc = CivilApplication.ActiveDocument;
Editor ed = doc.Editor;
var peo = new PromptEntityOptions("\nSelect an alignment: ");
peo.SetRejectMessage("\nThat is not an alignment.");
peo.AddAllowedClass(typeof(Alignment), true);
PromptEntityResult per = ed.GetEntity(peo);
if (per.Status != PromptStatus.OK) return;
ObjectId surfaceId = cdoc.GetSurfaceIds()[0]; // the first surface, for illustration
using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
{
Alignment al = (Alignment)tr.GetObject(per.ObjectId, OpenMode.ForRead);
TinSurface surface = (TinSurface)tr.GetObject(surfaceId, OpenMode.ForRead);
var sb = new System.Text.StringBuilder("station,x,y,z\n");
for (double sta = al.StartingStation; sta <= al.EndingStation; sta += 10.0)
{
double x = 0, y = 0;
al.PointLocation(sta, 0.0, ref x, ref y); // coordinates of the station on the centerline
double z;
try { z = surface.FindElevationAtXY(x, y); }
catch { z = double.NaN; } // outside the surface
sb.AppendLine($"{sta:F2},{x:F3},{y:F3},{z:F3}");
}
System.IO.File.WriteAllText(@"C:\temp\profile_samples.csv", sb.ToString());
tr.Commit();
}
}The two calls that matter are the conversion from a station to coordinates (PointLocation) and the surface lookup (FindElevationAtXY). A close cousin of the first, StationOffset, converts coordinates back to a station and offset, which is the key to bringing GIS points (crashes, parcels, utilities) onto an alignment. See Parcels, Alignments and Corridors in Civil 3D: A GIS Perspective and Transportation and Corridor Design: Integrating Civil 3D with GIS.
What a CAD manager must know about the API
- It changes between versions, sometimes in small ways that break tools. Budget time to rebuild and retest tools for each release.
- It needs a development process: source control, review, testing and a release procedure.
- It runs inside a transaction model that protects the drawing, if you use it correctly: open for read, write only when needed, always commit or abort.
- It’s powerful enough to damage a project: a tool that edits objects in bulk deserves the same care as a database migration.
Dynamo or the API? Choosing
| Question | Points to Dynamo | Points to the API |
|---|---|---|
| Who will build and maintain it? | Designers and technicians | A developer or a technically strong CAD manager |
| How stable is the task? | Exploratory, changing | Stable, repeated, critical |
| How complex is the logic? | Moderate | High |
| Does it need a user interface? | Not much | Yes |
| Must it run headless in batch? | No | Yes |
| How many users? | A few | Many |
| How fast must it be? | Modest | High |
| How long must it live? | Months | Years |
| Is there a ready package node? | Yes | No, or the node is limited |
A pattern that works well: prototype in Dynamo, to learn what the task really needs, and rebuild in the API when it becomes a product that many people depend on.
Examples of Dynamo Graphs for Civil 3D and GIS Work
These are descriptions of graphs (sequences of nodes). The exact node names depend on the Civil 3D version and the packages installed.
1. Create COGO points from a CSV
- Read the file: a file path node, then a node that reads CSV or Excel into a list of rows.
- Split the columns into point number, easting, northing, elevation and description.
- Create points: a node that makes Civil 3D COGO points from coordinates.
- Set properties: description, point group, style.
- Report: a count and any rows that failed.
Useful for importing survey data that doesn’t arrive in a standard format. Check the data first. See Civil 3D and GIS in Land Development and Surveying.
2. Create alignments from GIS centerlines
- Input: a CSV or JSON export of centerline vertices from the GIS (one line per route, with coordinates in the project’s system).
- Group the vertices by route ID.
- Create polylines, then alignments from them, with names from the route IDs.
- Apply styles and labels.
- Optionally fit curves to a design speed rule.
- Output: a list of created alignments and any failures.
This turns a GIS corridor study into a Civil 3D starting point in minutes. See Transportation and Corridor Design: Integrating Civil 3D with GIS.
3. Export a parcel schedule
- Get all parcels in a site.
- Read their number, name, area and perimeter (and custom properties).
- Write a table to Excel or CSV.
- Add a column for the area type (grid or recorded), and flag differences against a recorded area table.
Feeds the land take schedules in Cadastre and Land Survey: From CAD Drawings to GIS Parcels.
3b. Chainage markers for the GIS handover
- Input: an alignment.
- Generate stations at fixed intervals (for example every 50 meters), with the start station and any station equations.
- Convert each station to coordinates.
- Output: a CSV (station, X, Y), to be loaded into the GIS as points.
You can prototype the logic outside Civil 3D, as in the helper below, to understand exactly what the graph must do.
import json
import math
def points_at_intervals(line, interval, start_station=0.0):
"""Points at fixed station intervals along a polyline given as (x, y) pairs."""
segs, total = [], 0.0
for (x1, y1), (x2, y2) in zip(line[:-1], line[1:]):
length = math.hypot(x2 - x1, y2 - y1)
segs.append((total, length, (x1, y1), (x2, y2)))
total += length
out, s = [], 0.0
while s <= total + 1e-9:
for cum, length, (x1, y1), (x2, y2) in segs:
if s <= cum + length + 1e-9:
t = 0 if length == 0 else (s - cum) / length
out.append((start_station + s, x1 + t * (x2 - x1), y1 + t * (y2 - y1)))
break
s += interval
return out
def format_station(s):
return f"{int(s // 1000)}+{s % 1000:06.2f}"
pts = points_at_intervals([(0, 0), (100, 0), (100, 100)], 50, start_station=1000.0)
for st, x, y in pts:
print(format_station(st), round(x, 1), round(y, 1))
# 1+000.00 0.0 0.0 | 1+050.00 50.0 0.0 | 1+100.00 100.0 0.0 | 1+150.00 100.0 50.0 | 1+200.00 100.0 100.0
features = [{"type": "Feature",
"properties": {"station": format_station(st), "measure": round(st, 3)},
"geometry": {"type": "Point", "coordinates": [round(x, 3), round(y, 3)]}}
for st, x, y in pts]
print(json.dumps({"type": "FeatureCollection", "features": features})[:120])On a real alignment with curves, the Civil 3D alignment itself computes the coordinates exactly, so the graph or the API should do the station-to-point conversion, and the GIS receives the points. The code above shows the shape of the task, and doubles as a check: compare its output with the graph’s, on a straight alignment, before trusting the graph on a curved one.
4. Quality checks across a drawing
- Collect pipes, structures or parcels.
- Test rules: pipe cover within limits, slope within limits, parcel area above a minimum, names following a pattern.
- Output a list of failures, with object names and values.
See Stormwater and Drainage Design with Civil 3D and GIS Data and Utilities Mapping with AutoCAD Map 3D and Civil 3D for the rules.
5. Bulk style and label changes
- Select objects (by type, by layer or by name pattern).
- Apply an object style and a label style.
- Log the changes.
An excellent way to bring old drawings to the current standard, and a perfect candidate for a read-only preview before the change. See Annotation, Scales and Plot Standards: From CAD Drawings to Professional Maps.
Python Nodes: The Bridge
When Dynamo lacks a node, a Python Script node lets you write the missing step. Inputs arrive in a list called IN, and you assign the result to OUT. This example takes a list of quadrant bearings and distances (as they appear on a survey plan) and a starting point, and returns coordinates, so that a graph can build a polyline from a legal description:
import math
import re
def parse_quadrant_bearing(s):
m = re.match(r"\s*([NS])\s*(\d+)\D+(\d+)?\D*(\d+(?:\.\d+)?)?\D*\s*([EW])\s*$", s.strip(), re.I)
if not m:
raise ValueError("cannot parse bearing: " + s)
ns, d, mi, se, ew = m.groups()
angle = float(d) + float(mi or 0) / 60 + float(se or 0) / 3600
ns, ew = ns.upper(), ew.upper()
if ns == "N" and ew == "E": return angle
if ns == "S" and ew == "E": return 180 - angle
if ns == "S" and ew == "W": return 180 + angle
return 360 - angle
legs = IN[0] # list of [bearing text, distance], for example ["N 45°30'15\" E", 100.0]
start = IN[1] # [x, y]
x, y = start[0], start[1]
points = [[x, y]]
for bearing, dist in legs:
az = math.radians(parse_quadrant_bearing(bearing))
x += dist * math.sin(az)
y += dist * math.cos(az)
points.append([round(x, 3), round(y, 3)])
OUT = pointsTested in a harness that mimics IN and OUT, a rectangular lot described by four legs returned the five corner coordinates, closing exactly on the starting point. (Dynamo’s Python engine has changed between versions, so check which Python version your Dynamo uses, and test the node there.) The same logic appears in Cadastre and Land Survey: From CAD Drawings to GIS Parcels. Keep logic in Python nodes small, commented and tested outside Dynamo first, since a graph is a poor place to debug code.
Connecting GIS and Civil 3D by Automation
Automation is where the two worlds meet most smoothly, because it turns exchange formats into workflows.
| Direction | What flows | How |
|---|---|---|
| GIS to Civil 3D | Centerlines, parcels, points, attributes | Export from GIS to CSV or GeoJSON in the project CRS. A Dynamo graph or API tool creates the Civil 3D objects, with names and properties from attributes |
| Civil 3D to GIS | Alignments, stations, parcels, pipes, surfaces | An automation reads Civil 3D objects, writes CSV or GeoJSON with coordinates and properties. The GIS loads and validates it. See Importing and Exporting GIS Data in AutoCAD Map 3D |
| Civil 3D to reports | Quantities, schedules | Excel output |
| GIS to checks on designs | Constraints, zoning, flood levels | Export design footprints to GIS, run overlays, return flags to the designers |
| Both to the cloud | Files and models | Automation pipelines using Autodesk’s cloud platform. See Autodesk Platform Services (APS): Web Viewers and APIs for CAD and GIS Data |
Rules for these exchanges
- State the coordinate system, units and vertical datum in every exchange file. See Coordinate Systems in AutoCAD Map 3D and Civil 3D Explained.
- Carry stable IDs, so that results can be joined back.
- Validate on arrival, in both directions. Check counts, ranges and geometry.
- Keep exchange files small and simple, CSV or GeoJSON, with a data dictionary.
- Log each run.
Governing What People Build
The temptation with Dynamo is that it is so easy that every designer builds their own graph, and the office accumulates dozens of undocumented tools. The “TOOLS_OLD” story in the first guide applies here too, in a friendlier disguise. The rules I applied:
- A registry of tools: name, purpose, owner, version, location and the Civil 3D versions it is tested with.
- Three levels: personal (anything goes, not for deliverables), team (reviewed, documented), and office (owned, versioned, supported).
- Review before promotion: another person reads the graph or the code, and runs it on test data.
- Documentation in the graph: notes, groups, named inputs, and a text box saying what it does and what it changes.
- Read-only mode by default, or a preview step, before anything edits objects.
- Test data: a small sample drawing for each tool, with the expected result.
- Version matrix: which version of the tool works with which version of Civil 3D and which packages.
- Packages under control: a list of approved packages and versions, installed from a shared location. Don’t let a graph depend on a package that nobody has vetted.
- Upgrade testing: before the office moves to a new release, run every office-level tool on its test data.
- Logging: tools that change data write a log (what, where, when, by whom).
- Training: teach people the graphs they use, and the concept of reading before writing.
- Retirement: remove tools that have been replaced, and keep a record.
- Security: review third-party packages and scripts before use, and restrict who may change the shared tool folders.
- Backups and undo: always run edits on copies first, and keep the standard of data safety that applies to any bulk change.
A Worked Example: From GIS Corridor Study to Civil 3D Starting Point
Task: a corridor study in GIS produced twelve candidate route centerlines. The design team wants them in Civil 3D as alignments, with chainage markers for the GIS handover and a parcel schedule for the preferred route.
- Agree the exchange: the project coordinate system (an EPSG code, meters), the vertical datum, the route IDs and the file formats. The GIS exports the centerlines (vertex coordinates by route) to CSV, with a README. Check on arrival: counts, coordinate ranges and duplicate vertices.
- Prototype in Dynamo: read the CSV, group vertices by route ID, create polylines and then alignments, name them from the IDs, and apply the office alignment style. The first run creates 12 alignments in 45 seconds. A check finds that two routes have duplicate vertices (zero-length tangents), so the graph removes duplicate consecutive points before creating the polylines.
- Review: a colleague runs the graph on a test drawing and on the real one, and compares the alignment lengths with the lengths computed from the CSV by a small script. They match to the millimeter on straight segments.
- Fit curves: the designers fit curves to each alignment according to the design speed rules. See Transportation and Corridor Design: Integrating Civil 3D with GIS for the radius check.
- Chainage markers: a second graph generates markers every 50 meters along the preferred alignment, with station and coordinates, and writes a CSV for the GIS. A check compares the first and last markers with the alignment’s start and end stations and positions.
- Parcel schedule: after the design, a third graph reads the right-of-way parcels and writes the schedule (parcel number, area, area type, owner reference) to Excel. The CAD manager’s rule: the area type column is mandatory.
- Promotion: the three graphs are reviewed, documented and promoted to the “team” level, with test drawings and the registry entry. After three projects, the “centerlines to alignments” graph is rebuilt as a .NET command, with an interface for choosing the style and the file, and promoted to the “office” level.
- Upgrade test: when the office moves to a new Civil 3D release, the test drawings reveal that one node in a package has been renamed. The fix takes an hour, because the test caught it before a project did.
- Result: the time from GIS study to Civil 3D starting point fell from two days to under an hour, with fewer transcription errors. And the design team kept a clear record of what was created from what.
The graphs weren’t impressive. The test drawings, the registry and the upgrade test were the real engineering.
Common Mistakes
- Building a giant graph that nobody can read.
- No documentation in or around the graph.
- Relying on unvetted community packages.
- Graphs that edit objects with no preview.
- Skipping test data and upgrade tests.
- Hard-coded file paths and names.
- Exchanging files without a coordinate system, units or IDs.
- Treating Dynamo as a batch engine when it needs a headless .NET tool.
- Writing complex logic in a Python node without testing it outside.
- No owner and no registry, so tools vanish when people leave.
- Ignoring version changes until the upgrade breaks the work.
- Automating a process that has no standard behind it.
Best Practices
- Prototype visually, productize in code when many people depend on the tool.
- Keep graphs small, named and commented.
- Read before write: preview changes, and keep logs.
- Test outside Civil 3D where you can, and on sample drawings where you cannot.
- Control packages and versions.
- Define exchange formats with coordinate systems, units and stable IDs.
- Register, review, document, train and retire.
- Test every office-level tool before each software upgrade.
- Keep the business rule in one place, so that a change in standard changes one tool.
Final Thoughts
The designer who built that graph in the front row is now a team leader, and she tells new staff something that I wish I had been wise enough to say: “Don’t ask what the software can do. Ask what you do every week that a machine could do, and write it down as steps.” Everything in Dynamo and the Civil 3D API is a consequence of that sentence. The tools are only the means of turning steps into a program.
If you are beginning, pick one repetitive task that touches civil objects and GIS data: turning a CSV into points, listing parcels with areas, or exporting stations and coordinates. Build it first as a read-only report. Then give it an owner, a test drawing and a line in a registry. When it is working and trusted, you will have done more than save an afternoon. You will have started a small, durable piece of your office’s engineering, which is what automation is really for.
Where to go next: see how automation reaches the web and the cloud in Autodesk Platform Services (APS): Web Viewers and APIs for CAD and GIS Data, and revisit the standards that make automation safe in Annotation, Scales and Plot Standards: From CAD Drawings to Professional Maps.



