- (defun c:tt ()
- (command "cmdecho" "0")
- (command "osmode" "0")
- (setq bl (getvar "clayer"))
- (princ "\n 请在屏幕拾取文字:")
- (if (setq cc (entsel" 【注意】只能选择块或文字:"))
- (progn
- (setq pt_cc (cadr cc))
- (if (/= cc nil)
- (progn
- (setq c (entget (car cc)))
- (setq nnn (cdr (assoc 0 c)))
- (setq name (assoc 0 c))
- (setq lr (assoc 1 c))
- (setq km (assoc 2 c))
-
- (if (= nnn "TEXT")
- (setq ss (ssget "x" (list '(0 . "MTEXT,TEXT") lr)))
- )
- (if (= nnn "MTEXT")
- (SETQ SS (SSGET "X" (LIST '(0 . "MTEXT,TEXT") lr)))
- )
- (if (= nnn "INSERT")
- (setq ss (ssget "x" (list name km )))
- )
- )
- (princ "没有选择任何内容!")
- )
-
- (if (/= ss nil)
- (progn
- (setq i (sslength ss))
- (setq j 0)
- (command "-layer" "m" "BJTP" "C" "1" "" "")
- (repeat i
- (setq a (entget (ssname ss j)))
- (setq XY (cdr (assoc 10 a)))
- (COMMAND "LINE" XY pt_cc "")
- (setq j (+ 1 j))
- )
- (PRINC (strcat "共找到"(rtos i 2 0)"处!"))
- (command "layer" "s" bl "")
- )
- (princ "没有找到你要的内容!")
- )
-
-
-
-
- )
- )
- )
|