CAB, This works great.. Could you help me understand it a little more?
(/ p1 p2 Dist vecs) = your setting p1 p2 as your local variables, is this correct? "dist" is for distance? what is "vecs"
(setq Dist 0.0) = starting with a zero point?
(while (and (or p1 = are you telling the program to look for the first point I pick?
(setq p1 (getpoint "\nFirst point: ")) = then telling it to use p1 as starting messuring point?
(setq p1 (getvar "LASTPOINT")) = Does this set the first point picked to be your starting point?
(setq Dist (+ Dist (distance p1 p2)) = your adding the first two points together
vecs (append vecs (list p1 p2)) = not to sure, but does this allow you to keep picking other points for the distance?
p1 p2)
(grvecs (append vecs '(1))) = again not sure..
(print (strcat " Running total is " (rtos Dist))) = showing my distance as I'm picking points? What is "rtos"?
)
(prompt (strcat "\nTotal distance: " (rtos Dist))) = then total of all points after I select enter?
Not sure how I did, but can you let me know?
Thanks..
And my variation.
(defun c:test (/ p1 p2 Dist vecs)
(setq Dist 0.0)
(while (and (or p1
(setq p1 (getpoint "\nFirst point: "))
(setq p1 (getvar "LASTPOINT"))
)
(setq p2 (getpoint p1 "\nNext point: "))
)
(setq Dist (+ Dist (distance p1 p2))
vecs (append vecs (list p1 p2))
p1 p2)
(grvecs (append vecs '(1)))
(print (strcat " Running total is " (rtos Dist)))
)
(prompt (strcat "\nTotal distance: " (rtos Dist)))
)