Here’s one way to turn a DWG‐based contour/polyline set into a Revit topo‐surface using Dynamo. I’ll break it into:
Preparing your DWG
Dynamo setup (including a couple of handy packages)
Node‐by‐node workflow
(Optional) Python fallback
—
1. Prep your DWG
• Make sure the contours in your DWG are either:
– 3D polylines (each vertex carries a Z-elevation), or
– 2D polylines + consistent text labels for elevation.
• Clean up any extra geometry—only keep the contours you need.
• Save it with a clear name, e.g. Contours.dwg.
2. Dynamo setup
Open your Revit project & launch Dynamo (v2.x).
In Dynamo’s Package Manager, install:
• Clockwork for Dynamo (for DWG import & polyline nodes)
• archi-lab.net (optional but has clean Topography nodes)
In a plan view, Link/Import your DWG into Revit (so it’s in the same document).
3. Node-by-Node Workflow
File Path & Import
FilePath.FromString → point to “Contours.dwg”
File.ImportAutoCad (Clockwork)
• Outputs a CAD import element
Extract Polylines
CAD.Curves (Clockwork) → feeds the ImportInstance
FilterByBoolMask to pull out only PolyCurves (if mixed curves/text)
Get Curve Vertices (Points)
Curve.Explode / Geometry.Explode → break PolyCurves into individual lines (optional)
Curve.PointsAtParameter → sample each curve at all its vertices
• Set the parameter list to [0.0,1.0] for start/end, or use PolyCurve.Vertices if available
Collect Unique Points
List.UniqueItems (to remove duplicates)
Build Revit Point Instances
Point.ByCoordinates(x,y,z) → re-create Dynamo points with correct Z
Create Topography
Topography.ByPoints (Revit → Site → TopoSurface)
• If using archi-lab: TopoSurface.ByPoints
Connect your list of Dynamo points to this node → voilà, you get a Revit TopoSurface
Sample Dynamo Layout
Node
Inputs
Outputs
FilePath.FromString
“C:/…/Contours.dwg”
filePath
File.ImportAutoCad
filePath, importAsLinks=false
CADInstance
CAD.Curves
CADInstance
curveList
Curve.CurveType / FilterByBoolMask
curveList, “PolyCurve”
polyCurves
Curve.Vertices (Clockwork)
polyCurves
vertexPoints
List.UniqueItems
vertexPoints
uniqueVertices
Point.ByCoordinates
uniqueVertices[x,y,z]
revitPoints
Topography.ByPoints
revitPoints
topoSurface
(You can also group/sort points into lists of lists—some Topo nodes prefer that—but Revit’s built-in Topography.ByPoints will accept a flat list.)
—
4. Optional: Python Import + Topo
If you’d rather script it, here’s a very stripped-down Python node example (assumes 3D polylines in DWG):
python
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
# 1) Import DWG
opts = DWGImportOptions()
dwgElem = doc.Import("C:\\path\\Contours.dwg", opts, doc.ActiveView)
# 2) Collect CAD geometry
collector = FilteredElementCollector(doc, dwgElem.Id).OfClass(ImportInstance)
importInst = collector.FirstElement()
geoObjs = importInst.GetImportSymbolGeometry()
# 3) Extract points
pts = []
for g in geoObjs:
curve = g as Curve
if curve:
for uv in [0.0, 1.0]:
xyz = curve.Evaluate(uv, True)
pts.append(xyz)
# 4) Create Topography
TransactionManager.Instance.EnsureInTransaction(doc)
topsurf = TopoSurface.Create(doc, pts)
TransactionManager.Instance.TransactionTaskDone()
OUT = topsurf
—
🎯 Next steps:
• Run the graph.
• Tweak point density (sample more points on long contours).
• Hide the DWG in Revit once your topo is built.
Let me know if you run into any hiccups, or if your DWG comes in 2D + text (I can show you how to parse text labels into Zs!).