Jump to content

Recommended Posts

Posted

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.

Posted

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)
)

 

Posted (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 by marko_ribar
Posted

Thanks you guys! I think I can make this work.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...