intersection lines between two surfaces

intersection lines between two surfaces

Anonymous
Not applicable
14,528 Views
15 Replies
Message 1 of 16

intersection lines between two surfaces

Anonymous
Not applicable

Hi,

I wonder how to get intersection lines between two surfaces in Civil3D API. It seems that the "MinimumDistBetweenSurfaces" command in Civil3D can do this work. But I can't find corresponding API.

Can anyone help me?

0 Likes
Accepted solutions (1)
14,529 Views
15 Replies
Replies (15)
Message 2 of 16

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

I don't know any API function to do that, so I guess the way is like to do that manually: create a new volume-surface that shows Surf1-Surf2, set the style to show contours (just one contour at elevation = 0) and extract that contour as this is the intersection-line between Surf1 and Surf2.

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 16

Anonymous
Not applicable

Expect more methods.

Anyway,thanks

0 Likes
Message 4 of 16

Anonymous
Not applicable

i tried the volume surface method but there is no function that "extract contours" in tin volume surface class. I tried to convert volume surface to normal tin surface but i got error. Do you have any other idea? 

0 Likes
Message 5 of 16

tyronebk
Collaborator
Collaborator

It is possible to paste the volume surface into a temporary TIN surface, extract the contour, then dispose of the temporary TIN surface. Granted, this is not a particularily elegant approach.

0 Likes
Message 6 of 16

Anonymous
Not applicable

I found a solution to this issue with the embedded command "minimum distance between surfaces". You can find this on the analyze tab under the ground  data cloumn. It couldn't be easier :). Now I'm trying to code some macro to use this command more autonomously. 🙂 Have a good day. 

Message 7 of 16

tyronebk
Collaborator
Collaborator

Yes, the "minimum distance between surfaces" is an option (as was noted in the very first post of this thread). The problem is that the API doesn't give easy access to the output of that command. The workaround I suggested (building on top of Alfred's suggestion) stays within the API:

  • create a temporary volume surface using the two surfaces
    • TinVolumeSurface.Create( "name", id1, id2 );
  • create a temporary TIN surface
    • TinSurface.Create( db, "name" );
  • paste the temporary volume surface into the temporary TIN surface
    • .PasteSurface( id );
  • extract the 0 contour
    • .ExtractContoursAt( 0.0 )
  • dispose of the temporary surfaces

Like I stated previously, it is not the most elegant approach but it works within the limits of the API.

0 Likes
Message 8 of 16

Anonymous
Not applicable
Hhaha sorry i got confused because of the come and go between a lot of discussion forum pages 🙂 minumum distance between surfaces mentioned in the first place 🙂 🙂
I didn't tried yet pasting volume surface to tin sutface, but i think it is gonna work very well.. Like you said the api doesnt let us using commands freely and programmaticly (or i couldn't figure out) thanks a lot!
0 Likes
Message 9 of 16

Anonymous
Not applicable

I tried the method it worked well. But the cons is; It extracted the contour as a polyline without the elevation. Minimum distance between surfaces command generating 3d polyline which has elevation data. It is ready for converting to featureline to use as a surface breakline.

 

Do you have any idea how can i convert the programmaticly extracted polyline (contour at 0.0) to the featureline and get elevation data from one of the surface that i used for getting intersection line? (it doesnt matter which the elevation is the same for both surfaces on that line)

0 Likes
Message 10 of 16

tyronebk
Collaborator
Collaborator

I would check the elevation of one of the two starting surfaces at any point along the polyline(s) and move the polyline(s) to that elevation, then convert it to a featureline.

 

pl.Elevation = srf2.FindElevationAtXY( GetPoint2dAt( 0 ) );
0 Likes
Message 11 of 16

tyronebk
Collaborator
Collaborator

Oops. I realized I didn't think the problem through corectly and posted an incorrect solution. You will need to convert the polyline to a 3dpolyline and get the elevation for each individual vertex from the surface, then convert it to a feature line.

0 Likes
Message 12 of 16

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> i tried the volume surface method but there is no function that "extract contours"

Do you mean you don't find a function in the API? Then make sure you have a style for the triangulated volume modell that displays just major contours with really large intervals. That will show then only the contour at elevation 0.0.

Then run .Explode on the volume surface ==> you'll get a blockreferece, run .Explode a second time (now with the blockreference) ==> that gives you now the contours as polyline(s).

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 13 of 16

tyronebk
Collaborator
Collaborator

Yes, I believe gorkemtosun was getting at the fact that the managed API does not have .ExtractContours() or .ExtractContoursAt() methods for volume surfaces. There is a COM method .ExtractContour() available for use with volume surfaces so you wouldn't have to explode the surface. But, like the Alfred's suggested workflow, you will still need to create a surface style that displays only the contours you want to extract.

0 Likes
Message 14 of 16

Simon_Noyola_Rivero
Enthusiast
Enthusiast

Hi,

 

I want to share this video:

 

https://www.youtube.com/watch?v=3-ZAO7UBtNs&feature=youtu.be

 

Simon Noyola Rivero
Application Engineer
Down to Earth Technologies, Inc.
Autodesk Authorized Consultant
Subject Matter Expert Civil&Map 
Civil 3D Country kit  development
para: Mexico, Central America, Caribbean & Venezuela
https://www.youtube.com/user/snoyolar

 

 

 

0 Likes
Message 15 of 16

leonardo.murte
Contributor
Contributor

Hello,

There is a new way to do this process.

Go to Analyze, then Ground data and select Minimum Distance Between Surfaces.

It will ask you to select the 2 surfaces you want to compare, then it will create a 3D Poly where the surface intersect.

Message 16 of 16

tyronebk
Collaborator
Collaborator

@leonardo.murte you have continued the tradition of this thread of mentioning the Minimum Distance Between Surfaces command. That command was mentioned in the very first post. The original poster was looking for a way to do the same thing as that command but only using the API.