A lot "similar": http://forums.augi.com/showthread.php?t=126660Just take note to be careful about global variables - especially when generating arbitrary numbers of them like with this code. In AutoLisp (and nearly all other languages) a global variable can cause quite many headaches as anything might modify / rely on it being there. Thus some other routine might rely on a pt2 being saved somewhere, but then fail because this one's modified / cleared the value. Or some other routine might clear one of these values and cause this routine to fail. The point is that you cannot think of all possibilities, since you cannot see the future (never mind that the present is a huge task to test for every possibility).
Though we haven't seen where these are supposed to be used. Are they meant to stay as global to be reused many times from different routines? We'd be able to give much better advise if we knew exactly what was supposed to happen with these points.
It's ok now, i use 2 separate lisps, and the result you can see in the attached drawing. Sorry, is not english in the drawing (IS ABOUT GROUND PROFILE, WITH HORIZONTALDISTANCES , ELEVATION VALUE - SORRY, NOT IN ENGLISH) And maybe somebody have a routine to do something similar like in the drawing... but anyhow it's ok now, thanks for help guys! I can show those 2 lisps that i use, but they are so bad...i'm afraid to do this
Drawing1.dwg
Drawing2.dwgWhat about a (let's say) "horizontal" polyline, intersected by many vertical lines, through vertices and through other points(not vertices)? I mean, to count first line -L1, second line - L2...and so on, from left to right, for example... HOW? see the drawing...
If you use the "VL-curve-getclosetpointto" command it will reduce your code immensely you just use the pline vertice and the VL it works out the perp point for you so simple, just pick pline, pick horizontal line and say datum level and vert scale = numbers just loop through the pline vertices does not matter how many.
Stole this from elsewhere whilst looking around today
(setq pd1 (getpoint "\nSelect first point ")) (setq pd (car (entsel "\nSelect line to extend to: "))) (setq pt (vlax-curve-getClosestPointTo pd pd1 T))