429014673 发表于 2012-5-14 19:54
严哥,这个很厉害,可以帮忙搞一个可以亮显的,没有画圆的吗?...我想找出相同的编号进行下一步操作....例如改 ... - ;;;简易查找文本并亮显 by yjr111 2012-5-14
- (defun c:ttz (/ stxt s1 ent ss )
- (setq stxt (getstring "\n输入要查找的文本<右键选取>或设置(S):"))
- (cond ((or(= stxt "S")(= stxt "s"))
- (initget"All Same")
- (setq key (getkword "\n相似全选(All)或完全匹配(Same)"))
- (if (not key)
- (setq key "Same")
- )
- (setq stxt (getstring "\n输入要查找的文本<右键选取>或设置(S):"))
- )
- )
- (cond((and (= stxt "")
- (setq s1 (entsel "\n选择标记 :"))
- (setq ent (entget (car s1)))
- (= (cdr (assoc 0 ent)) "TEXT")
- )
- (redraw (car s1) 3)
- (setq stxt (cdr (assoc 1 (entget (car s1)))))
- )
- )
- (princ"\n选择文本的查找范围")
- (if (= key "Same")
- (setq ss (ssget (list '(0 . "TEXT") (cons 1 (strcat stxt)))))
- (setq ss (ssget (list '(0 . "TEXT") (cons 1 (strcat "*" stxt "*")))))
- )
- (if (and ss (> (sslength ss) 0))
- (progn (princ (list "\n总共找到" (sslength ss) "处"))
- (sssetfirst ss ss)
- )
- )
- (princ)
- )
|