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
@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?].
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
@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.
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 ☺
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
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.
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..
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
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