这可能对你有所帮助。
如果你点击了一个文本,它将从一开始返回(在调用例程时阅读命令行)
- (defun c:sub (/ ss1 ss2 ss3 st1 st2 st3 e)
- ; Tharwat 20.01.2011
- (while
- (not (and (setq ss1
- (car (entsel "\n Select first text to subtract from :")))
- (setq ss2
- (car (entsel "\n Select second text :")))
- (setq ss3
- (car (entsel "\n Select text to insert the result:")))
- ))
- )
- (progn
- (setq st1
- (cdr (assoc 1 (entget ss1))))
- (setq st2
- (cdr (assoc 1 (entget ss2))))
- (setq st3
- (cdr (assoc 1 (setq e (entget ss3)))))
- (entupd (cdr
- (assoc -1
- (entmod (subst
- (cons 1 (rtos (- (distof st1) (distof st2)) 2 3))
- (assoc 1 e)
- e)
- )
- )
- )
- )
- )
- (princ)
- )
-
|