Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

intersection lines between two surfaces

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
zzffxx
11157 Views, 15 Replies

intersection lines between two surfaces

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?

15 REPLIES 15
Message 2 of 16
Alfred.NESWADBA
in reply to: zzffxx

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
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 16
zzffxx
in reply to: zzffxx

Expect more methods.

Anyway,thanks

Message 4 of 16
gorkemtosun
in reply to: zzffxx

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? 

Message 5 of 16
tyronebk
in reply to: gorkemtosun

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.

Message 6 of 16
gorkemtosun
in reply to: tyronebk

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
in reply to: gorkemtosun

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.

Message 8 of 16
gorkemtosun
in reply to: zzffxx

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!
Message 9 of 16
gorkemtosun
in reply to: gorkemtosun

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)

Message 10 of 16
tyronebk
in reply to: gorkemtosun

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 ) );
Message 11 of 16
tyronebk
in reply to: tyronebk

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.

Message 12 of 16

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
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 13 of 16
tyronebk
in reply to: Alfred.NESWADBA

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.

Message 14 of 16

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

 

 

 

Message 15 of 16
leonardo.murte
in reply to: zzffxx

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
in reply to: leonardo.murte

@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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report