tnvsb Posted September 29, 2018 Posted September 29, 2018 (edited) Dear Helpers, I got a lisp code that can select text elements in entire drawing by user input. But it's not working for case sensitive letters and also not asking for window selection. Please do needful. (defun C:SWT (/ str ss) ; = Find String(s) by Content (setq str (getstring "\nYour [full or partial] string content to search for: ")) (if (setq ss (ssget "_X" (list (cons 0 "*TEXT") (cons 1 (strcat "*" str "*")) (cons 410 (getvar 'ctab))))) (sssetfirst nil ss); select/highlight/grip ); if ); defun Regards, T.Brahmanandam. Edited September 29, 2018 by tnvsb Quote
marko_ribar Posted September 29, 2018 Posted September 29, 2018 (edited) MODIFICATION IN CODE (TO AVOID CASE SENSITIVE IN TEXT SELECTION FROM LISP) MODIFICATION IN CODE (TO ACCEPT CASE SENSITIVE IN TEXT SELECTION FROM 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. Edited September 29, 2018 by marko_ribar 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.