- (defun dengfen(/ s d0 d n d1 p)
- (prompt"\n选择曲线")
- (if(setq s(ssget ":S"'((-4 . "<AND")(0 . "*line,arc")(0 . "~?line")(-4 . "AND>"))))
- (progn(setq s(vlax-ename->vla-object(ssname s 0))
- d0(vlax-curve-getDistAtParam s(vlax-curve-getEndParam s))
- d(getreal(strcat"所选曲线长度"(rtos d0 2 2)"等分距离或者分段数(用负整数表示)")))
- (if(< d 0)(progn(setq d(abs d)n 0 d0(/ d0 d))
- (while(< n(1- d))(setq n(1+ n)
- p(append p(list(vlax-curve-getpointatdist s(* d0 n)))))))
- (progn(setq d1 0)
- (while(< d1 d0)
- (setq d1(+ d1 d)p(append p(list(vlax-curve-getpointatdist s d1)))))))
- (setq p(append(list(vlax-curve-getstartpoint s))p(list(vlax-curve-getendpoint s)))))))
|