- (defun c:tt (/ l1 l2 dxf)
- (if (and (princ "选择块:")
- (while (not l1)
- (setq l1 (ssget ":E:S" '((0 . "INSERT"))))
- )
- (princ "选择用于显示块名的文字对象:")
- (while (not l2)
- (setq l2 (ssget ":E:S" '((0 . "TEXT"))))
- )
- (setq l1 (ssname l1 0)
- l2 (ssname l2 0)
- dxf (entget l2)
- dxf (subst (cons 1 (cdr (assoc 2 (entget l1)))) (assoc 1 dxf) dxf)
- )
- )
- (entmod dxf)
- )
- (princ)
- )
|