要插块什么的自己改- (vl-load-com)
- ;;;by x_s_s_1@163.com
- (defun c:test1 (/ old_os en pts pt dis pts-start pt-start n)
- (setq old_os (getvar "osmode"))
- (setq en (car (entsel "\n选择需等分线:")))
- (setvar "osmode" 15359)
- (setq pts (getpoint "\n选择等分起始点:"))
- (setvar "osmode" 512)
- (setq pt (getpoint "\n选择等分方向:"))
- (setq dis (getreal "\n输入等分距离:"))
- (setq pts-start (vlax-curve-getDistAtPoint en pts))
- (setq pt-start (vlax-curve-getDistAtPoint en pt))
- (setq n 1)
- (if (> pt-start pts-start)
- (while (setq pt (vlax-curve-getPointAtDist en (+ pts-start (* n dis))))
- (entmake (list '(0 . "point") (cons 10 pt)))
- (setq n (1+ n))
- )
- (while (setq pt (vlax-curve-getPointAtDist en (- pts-start (* n dis))))
- (entmake (list '(0 . "point") (cons 10 pt)))
- (setq n (1+ n))
- )
- )
- (setvar "pdmode" 3)
- (setvar "osmode" old_os)
- (princ)
- )
|