- (defun c:tt ()
- (defun SSelEntnext (en / ss)
- (setq ss (ssadd))
- (while (setq en (entnext en)) (ssadd en ss))
- ss
- )
- (setq nn (getint "\n等分数量: "))
- (or nn (setq nn 21))
- (setq s1 (car (entsel "\n选择曲线: ")))
- (setvar "osmode" 0)
- (setq s0 (entlast))
- (command "divide" s1 nn)
- (setq ss (SSelEntnext s0)
- p1 (vlax-curve-getEndPoint s1)
- i -1
- ptn '()
- )
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq ptn (cons (cdr (assoc 10 (entget s1))) ptn))
- )
- (command "erase" ss "")
- (setq ptn (mapcar '(lambda (x) (list (car x) (cadr p1))) ptn)
- ptn1 (mapcar '(lambda (x) (list (car x) (- (cadr x) 1000))) ptn)
- )
- (mapcar '(lambda (x y) (command "line" x y "")) ptn ptn1)
- (command "line" (car ptn) (last ptn) "")
- (command "line" (car ptn1) (last ptn1) "")
- (princ)
- )
|