(defun c:t1 (/ en dist length-en nn vl-en vl-en old_osmode) (vl-load-com) (setq *acadobject* (vlax-get-acad-object) *acaddocument* (vla-get-activedocument *acadobject*) *mspace* (vla-get-modelspace *acaddocument*) ) ;_ endsetq
(setq en (car (entsel "please select a spline: "))) (if (null en) (exit) ) ;_ endif (setq dist (getreal "please input the distance that you want: ")) (if (null dist) (setq dist 1) ) ;_ endif (vla-startundomark *acadDocument*) (command "lengthen" en "") (setq ss1 (ssadd) old-osmode (getvar "osmode") old-cmdecho (getvar "cmdecho") length-en (getvar "perimeter") nn (fix (/ length-en dist)) i 0 vl-en (vlax-ename->vla-object en) c (ssadd) pt-end (cdr (last (entget en))) ) ;_ Endsetq (if (< length-en dist) (exit) ) ;_ Endif (setvar "osmode" 0) (setvar "cmdecho" 0) (repeat nn (setq pt0 (vlax-curve-getpointatdist vl-en (* (+ i 0) dist)) pt1 (vlax-curve-getpointatdist vl-en (* (+ i 1) dist)) i (1+ i) ) ;_ Endsetq (command "line" pt0 pt1 "") (ssadd (entlast) ss1) ) ;_ Endrepeat (command "line" pt1 pt-end "") (command "pedit" (entlast) "y" "j" ss1 "" "") (setvar "osmode" old-osmode) (setvar "cmdecho" old-cmdecho) (vla-endundomark *acadDocument*) ) ;_ enddefun
|