Civil 3d - Extract User Contour from Surface

I’m very interested in knowing if it is possible in Dynamo to: 1. select a surface, 2. enter a real number (an elevation that must be between min and max elevations). 3. create a civil 3d surface style with that elevation in the name. 4. modify that style to show only user contours ‘with only the above elevation’ specified. 5. extract that user contour as a polyline.

Doing this manually is very easy, but can become tedious if you do this a lot.

Hi @sgrisez,

If your end goal is simply to extract specific contours as polylines, then you could save yourself a lot of work by skipping steps 3 and 4. Modifying styles is not currently available, so you’d have to dig into the COM API.
https://help.autodesk.com/view/CIV3D/2020/ENU/?guid=GUID-850D4AC4-4007-448B-8B23-FE3971A4423C

But you can extract the polylines at a specific elevation pretty easily using the Civil 3D Toolkit, something like this.

So it looks like I don’t need to create the style with the user contour set to that number, (which is awesome!), is that correct?

Correct

How/where do I get the Civil 3d toolkit? I have c3d2021.

found it. It is a package to to download via ‘packages’

I’m so happy that this worked and was so easy.

Glad to hear it!

I think some functions have been added to Core Dymamo. I think this can now be done with two nodes. 1. Select objects and 2. extract the user contour but I can’t find that 2nd node. Is that correct. Currently I need to downgrade my civil 3d toolkit in order to get this to run.

Basically, I’m looking ot select a surface and then extract a user contour elevation.

I believe you showed a node a few days ago that was able to acquire a user contour. It went by so fast that I did not have a chance to get a screen shot.

Hi @SGrisezPPeng,

There are a few nodes available in Civil 3D 2025.1 that might get you what you need.

Then to draw the polylines in Civil 3d is there another node? or does that node create the polylines? Does the Curve output create the polylines or do you need something else?

The output is Dynamo curves, then you could use Object.ByGeometry to create polylines if that is your end goal.

In 2025.2 The attached graph screenshot works.

  1. Can I reverse the inputs? - See screen shot. Let’s say I want the selection to be the first input.

  2. Also, if I run this multiple times it erases the previous polyline. What do I need to do to prevent the program from deleting the previous polyline created on subsequent runs.

See this.

Just a minor clarification…what you’re seeing is that the original polyline is getting updated or “moved” each time you change the elevation. This is the default behavior as it is very useful for the majority of cases. You are interested in the second use case, which is where Dynamo functions more like a LISP routine that just “runs and forgets”. We are working on making this a little easier to achieve, but what you have to do right now is turn off object binding.

More info here: