• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Leggi altro.

Somma progressiva delle distanze

PlannerRoad

Moderatore
Staff Forum
Professione: Variabile
Software: AutoCAD 2016
Regione: Italia
#1
DIST2

Consente di sommare in progressione le distanze.

"The standard AutoCAD DIST command measures only distances between two points.
If you want to measure a cumulative (total) distance defined by consecutive point clicks (multiple line segments), you can use the DIST2 LISP."

http://www.cadforum.cz/cadforum_en/dl_file.asp?ID=760
 
Ultima modifica:
Professione: *
Software: AutoCAD
Regione: Lombardia
#2
CUMD

(defun c:cumd ()
(setvar "cmdecho" 0)
(graphscr)
(setq
p1 (getpoint "\nPick start point ")
p2 (getpoint p1 "\nPick next point ")
d1 (distance p1 p2)
prdist (strcat "\nDistance: " (rtos d1))
)
(princ prdist)
(setq p3 (getpoint p2 "\nPick next point or RETURN if done "))
(while p3
(setq
d0 (distance p2 p3)
d1 (+ (distance p2 p3) d1)
p2 p3
prdist (strcat "\nDistance: " (rtos d0) ", Cumulative distance: " (rtos d1))
)
(princ prdist)
(setq p3 (getpoint p2 "\nPick Next Point "))
)
(setq cumd (strcat "Cumulative distance --> " (rtos d1)))
(prompt cumd)
(princ)
)