Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pipeline Topo

16 REPLIES 16
Reply
Message 1 of 17
imtaha
1435 Views, 16 Replies

Pipeline Topo

Hi every body,

 

I have little knowledge about lisp routines and I need help with a lisp routin. What I have is a topo plan in 3D (All contour lines have x, y and z values). My pipeline is on x and y coordinate only. I need to get the corrosponding z value for say about 2000 points on the pipeline. Help is urgently needed.

 

Thanks

16 REPLIES 16
Message 2 of 17
Kent1Cooper
in reply to: imtaha


@imtaha wrote:

.... What I have is a topo plan in 3D (All contour lines have x, y and z values). My pipeline is on x and y coordinate only. I need to get the corrosponding z value for say about 2000 points on the pipeline. Help is urgently needed.

....


That sounds like a job for

 

(vlax-curve-getClosestPointToProjection curve-obj givenPnt normal [extend])

 

Presumably the"curve-obj" argument would be a contour-line Polyline, the "givenPnt" argument would be one of those 2000 points on the pipeline, and the "normal" argument would be '(0 0 1) [straight up in the Z direction].  You would probably need to step through all the contour lines for each pipeline point, make a list of the closest point for each, calculate the two that are closest in X,Y coordinates, then interpolate between them somehow, depending on how precise you need it to be.  That would give you the [perhaps approximate] Z value for the place on grade at the pipeline point position, from which you can subtract or add something to get an elevation below or above grade.

 

You haven't said what you would do with that information [label with text in the drawing? send to external file? make the pipeline Polyline 3D to follow the contours?].  Nor do we know yet what defines those 2000 points [Polyline vertices? equally-spaced distances along it, regardless of their relationship to vertices? intersections with some reference grid?].

Kent Cooper, AIA
Message 3 of 17
imtaha
in reply to: Kent1Cooper

Thanks Kent for your reply,

 

Actually what i need is the apparent intersection points of the 2D polyline (Pipeline) with the 3D contour lines. If I can get the whole lisp, that wiil really help me today. (I have little lisp knowledge)

 

Thanks

Message 4 of 17
imtaha
in reply to: imtaha

more clarification   I need the x,y and z for the apparent intersection points

 

Thanks

Message 5 of 17
Kent1Cooper
in reply to: imtaha


@imtaha wrote:

... what i need is the apparent intersection points of the 2D polyline (Pipeline) with the 3D contour lines. ....


I picture stepping along the pipeline Polyline in something-smaller-than-Osnap-Aperture steps, using (vlax-curve-getPointAtDistance) with a successive addition to the distance, and:

1. apply Osnap APPINT at each spot [which I believe will return a pont at the current elevation if the two Polylines don't actually intersect in 3D];
2. if there's a result, and it isn't the same as the previously-found apparent intersection, then:

  a. save it for comparison of later apparent intersections;

  b. apply (ssget "C") with that point twice, to find the applicable contour line Polyline [the one in the resulting selection set that isn't the pipeline];

  c. apply (vlax-curve-getClosestPointToProjection) with that point and that contour Polyline;

  d. do whatever it is you need to do with the resulting point information.

 

I won't be able to work that out today, but if someone else doesn't beat me to it, I'll give it a try later.

Kent Cooper, AIA
Message 6 of 17
Patchy
in reply to: imtaha

How about zip and post the topo and the pipeline here, maybe LandDesktop can crank it out today while Kent and other can work on their magic ☺

Message 7 of 17
imtaha
in reply to: Kent1Cooper

Thanks Kent,

 

I really appreciate your time and I will be waiting for your magic. It will be nice if we can export the x, y and z coordinate to an excel file. So we can draw a 3D poly line, basically that what I want I want convert the poly line to a 3D poly line using the 3D topo plan so it actually follow the land, instead of having it on a 2D plane.

 

Thanks again

Message 8 of 17
imtaha
in reply to: Patchy

Thanks for your help, I tried to attach a zip file, but the zip file size is too large to attach.

Message 9 of 17
stevor
in reply to: imtaha

To avoid programmers having to make wild guesses, or not even trying, provide SOME of the topo file that includes your 2D pipe LWPOLYLINE and a few topo lines, of whatever type they are; in a 2000 format, without any other objects, especially texts  and reactors.

 

S
Message 10 of 17
imtaha
in reply to: imtaha

Thanks here is part of the file. The actual size is 65 MB.

 

 

Message 11 of 17
imtaha
in reply to: imtaha

Hi Kent,

 

I was wondering if you get chance to solve my problem? thanks.

Message 12 of 17
devitg
in reply to: imtaha

I will try it .
Message 13 of 17
imtaha
in reply to: imtaha

Thanks Kent!
Message 14 of 17
devitg
in reply to: devitg

IMTAHA , please check it . Contours SHALL be at "contour line" or "main contour line" LAYERS Maybe it is not what do you need , but I think it can be a real world work . It is in ACAD 2007 Send me the whole DWG , you may want to send off topic to my e mail , see attached txt file
Message 15 of 17
stevor
in reply to: imtaha

While I picture collecting all the topos that cross the pipe with ssget fence, and changing the Z of a copy to the pipe Z, geting the intersection points, entdel that copy, one topo at a time; then sorting the closest pts on the pipe by their parameters..

S
Message 16 of 17
imtaha
in reply to: stevor

I have almost no lisp writing experience, can you please write one that do what you are saying for me, I would really appreciate it.

 

Thanks

Message 17 of 17
imtaha
in reply to: devitg

Thankd Devitg, I'm really looking for a lisp routine to get the z values of the intersection points of the 2D poly (Pipeline) with the 3D topo contour lines. It would be a great help for me.

 

Thanks

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

Post to forums  

Autodesk Design & Make Report

”Boost