(defun c:pc (/ ss lst)
;; Spline Connect
;; Alan J. Thompson, 05.15.10
(vl-load-com)
(if (setq ss (ssget '((0 . "LWPOLYLINE"))))
(progn
(vl-cmdf "_.pline")
(foreach p (vl-sort
((lambda (i)
(while (setq e (ssname ss (setq i (1+ i))))
(setq lst
(cons
(car
(vl-sort (list (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e))
(function (lambda (a b) (> (cadr a) (cadr b))))
)
)
lst
)
)
)
)
-1
)
(function (lambda (a b) (< (car a) (car b))))
)
(vl-cmdf "_non" (trans p 0 1))
)
(vl-cmdf "" "" "")
)
)
(princ)
)
(c:pc)

Advertisements