rcb007 Posted March 1, 2022 Posted March 1, 2022 I having been using the following where i usually just place it in the command line then replace the values to what i need. I am having a hard time trying to get this to a routine which would either ask me, at the command line rather than placing it within the ssx method. (setq ss (ssget "x" (list (cons 2 "YourBlockNameHere")))) ;;will create a selection set of insertions for a given block. (setq ss (ssget "_X" (list (cons 0 "*TEXT")(cons 1 "*TEXTVALUE*")))) ;;select text with wildcard value Thanks for any direction. Quote
Emmanuel Delay Posted March 1, 2022 Posted March 1, 2022 Like this? ;; Select Text with Wildcard (defun c:stw ( / wildcard ss) ;; comment out one of those possibilities ;; in case the user needs to write the * symbols (setq ss (ssget "_X" (list (cons 0 "*TEXT")(cons 1 (setq wildcard (getstring "\nWildcard (include * where needed):" T)) )))) ;;select text with wildcard value ;; in case the there's always *...* (setq ss (ssget "_X" (list (cons 0 "*TEXT")(cons 1 (setq wildcard (strcat "*" (getstring "\nWildcard (don't include *):" T) "*")) )))) ;;select text with wildcard value ;; just to see that it works, print the number of selected *text objects (princ (sslength ss)) (princ) ) Quote
marko_ribar Posted March 1, 2022 Posted March 1, 2022 (edited) (setq ss (ssget "_X" (list (cons 2 (cond (getstring "\nYour block name wcmatch pattern : ") ("*")))))) (setq ss (ssget "_X" (list (cons 0 "*TEXT") (cons 1 (cond (getstring T "\nSpecify value wcmatch pattern of *TEXT entity types for ssget search : ") ("*")))))) Edited March 1, 2022 by marko_ribar Quote
rcb007 Posted March 2, 2022 Author Posted March 2, 2022 Thanks you guys! I think I can make this work. 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.