代码修改(避免LISP文本选择区分大小写)
代码修改(接受LISP中区分大小写的文本选择)
- (defun C:SWT ( / str ss sss i txt ) ; = Find String(s) by Content
- (setq str (getstring "\nYour [full or partial] string content to search for: "))
- (setq sss (ssadd))
- (if (setq ss (ssget (list (cons 0 "*TEXT") (cons 410 (getvar 'ctab)))))
- (repeat (setq i (sslength ss))
- (setq txt (ssname ss (setq i (1- i))))
- (if (wcmatch (cdr (assoc 1 (entget txt))) (strcat "*" str "*"))
- (ssadd txt sss)
- ); if
- ); repeat
- ); if
- (if sss
- (sssetfirst nil sss); select/highlight/grip
- ); if
- (princ); quiet exit
- ); defun
HTH。,M、 R。 |