Extract contour lines from a surface and then split them to Major/Minor Contour Lines

Hello

I tried to extract the contour lines from a surface to polylines, i did with the help of Surface.ContoursByInterval / Surface.ContourByRange.
I want to go little bit further, and create two separate lists splitting them in Major/Minor.
I tried calculated the modulus of the elevation of contour line with the interval multiplied by 5, expecting zero modulus for the major and non zero for the minor contour, but did not work.
Has anyone else achieved this before?

Thank you

This might be a dumb response, but Civil3D has a native way to extract contour lines to polylines. You don’t need to do that with Dynamo unless you want to.

Click on a surface > Surface Tools > Extract From Surface > Extract Objects > Major/Minor Contours.

You can select the contours you want to extract or you can extract all contours.

Is this not what you want to do?

Hi @dogcam

Yes sure could be done , but first in advance have to check the correct computation in intervals and switch on the contours from the surface style.
I need it because i have LOT of surfaces…

Regards

Okay. I don’t have time to make a script at the moment, but I might take a crack at it when I have some free time. Looking at the NET API reference, it looks like there are several methods for extracting contours from a surface as polylines. See the example here: Help

It would be possible to make a python node that calls these methods and gets the contours of a surface as polylines.

Hi @nkiakas,

There are several ways you could do this, but here’s one approach if you don’t want any duplicates between majors and minors.

MajorMinorContours.dyn (15.7 KB)

1 Like

Hi @zachri.jensen and @dogcam and thank you for your reply.

@zachri.jensen i tried your approach and works perfect with a single surface.
When i select several surfaces there is a problem with the segregation of minor contours elevations. The list supposed to include the minor elevations, including (some of them not all) major contour elevations.
This comes because each surface has its own range for major/minor elevations and during the SetDifference function, there are “remaining” major values are included in minor elevations lists.

Regards