;;
Select object (point only) and draw polyline
(defun c:p2pl (/ sset p1 n p2 ss1 ss2)
(setq
old_cmdecho (getvar
"cmdecho")) ; cmdecho
(setq
old_osnap (getvar "osmode")) ;
osnap
(setvar
"cmdecho" 0) ; (off) cmdecho
(prompt
"\nDraw Polyine From Points")
(Setq
sset (ssget '((0 . "POINT"))))
(Setq
p1 nil
ss1
nil
)
(setvar
"osmode" 0) ; (off) object
snap
(repeat
(setq n (sslength sset))
(setq p2 (cdr (assoc 10 (entget (ssname
sset (setq N (- N 1)))))))
(if (/= p1 nil)
(progn
(command "_.pline"
"_none" p1 "_none" p2 "")
(setq ss2 (entlast))
)
)
(if (/= ss1 nil)
(progn
(command "_.pedit"
"_multiple" ss1 ss2 "" "_join" "0.0"
"")
(setq ss1 (entlast))
)
(setq ss1 ss2)
)
(setq p1 p2)
)
(setvar
"cmdecho" old_cmdecho) ;
old_cmdecho
(setvar
"osmode" old_osnap) ; old_osnap
(princ)
)