;----------------SPL2POL.LSP--------------------------------- ;-------Change of an SPLINE to a POLYLINE-------------------- ;Given is an SPLINE. It will be changed into an approximated POLYLINE. ;--spli : spline ;--aufl : number of vertices for the approximation ;--pt : vertex ;------------------------------------------------------------- ;------------------------------------------------------------- ;(defun C:spl2pol (/ spli aufl elem p0 pkt ll) (defun C:spl2pol () ;------------------------------------------------------------- (setq pktliste nil) (print "Please select a spline :") (setq spli (ssget)) (setq aufl (getint "\nnumber of vertices:<300> : ")) (if (= nil aufl) (setq aufl 300)) (setq elem (entget (ssname spli 0))) (setq p0 (cdr (assoc 10 (entget (ssname spli 0))))) (if (= (cdr (assoc 0 elem)) "SPLINE") (progn (command "_divide" spli aufl) (setq pktsatz (ssget "_p")) (setq ll (sslength pktsatz)) ;(PRINT ll) (command "_3dpoly") (command p0) (setq i -1) (setq ll (- ll 1)) (while (< i ll) (progn (setq i (+ 1 i)) (setq pkt (cdr (assoc 10 (entget (ssname pktsatz i))))) (command pkt) ) ) (command "") ) (princ (strcat (cdr (assoc 0 elem)) " is no SPLINE----->EXIT")) ) (command "_ERASE" pktsatz nil) (princ) )