;DIST2 - cumulative distance
;(C)2008 - XANADU a.s. - www.xanadu.cz - www.cadforum.cz

(defun c:Vzd2 () (c:Dist2))

(defun c:Dist2 ( / cdist fpoint npoint)
 (setq cdist 0.0)
 (setq fpoint (getpoint (strcat "\n[" (rtos cdist) "] Pick first point:")))
 (while (setq npoint (getpoint fpoint (strcat "\n[" (rtos cdist) "] Pick next point <end>: ")))
  (setq cdist (+ cdist (distance fpoint npoint)))
  (setq fpoint npoint)
 )
 (princ (strcat "\nTotal distance: " (rtos cdist)))
 (princ)
) 