;;; Saved from: http://www.cadtutor.net/forum/showthread.php?48022-spline-lisp&p=326804&viewfull=1#post326804
(defun c:sc (/ ss lst)
;; Spline Connect
;; Alan J. Thompson, 05.15.10
(vl-load-com)
(if (setq ss (ssget '((0 . "LWPOLYLINE"))))
(progn
(vl-cmdf "_.spline")
(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:sc)

Advertisements