Jump to content

Selection Sets w/Wildcard??


ILoveMadoka

Recommended Posts

We work on alot of drawings converted from Solidworks and we typically delete Solidworks specific blocks. What I'm wondering is

if it possible to create a selection set that uses a wildcard.

(or the correct way to accomplish the same thing).

 

Here is a sample of how I know how to select one of the blocks

 

(setq aa (ssget "x" '((0 . "INSERT") (2 . "SW_CENTERMARKSYMBOL_17"))))

 

All the blocks have an "SW_" prefix.

Is it possible to select something along these lines?

(2 . "SW_*)

 

If someone could provide some direction it would be greatly appreciated!

 

TIA!

Link to comment
Share on other sites

Thanks!

 

Personally I hate when someone asks a question about code but doesn't post

what they did to make it work. I like to see others solutions.

 

With that said, here is my simple little app..

 

(defun c:SW ()

(setq aa (ssget "_X" (list (cons 0 "INSERT") (cons 2 "SW_Cen*"))))

(command "Erase" aa "")

(princ))

 

 

I'm sure I can't be the only person who didn't know how to do this..

 

Thanks again!

Link to comment
Share on other sites

If I might make a slight modification...

 

(defun c:SW (/ aa)
 (if (setq aa (ssget "_X" (list (cons 0 "INSERT") (cons 2 "SW_Cen*"))))
   (command "_.Erase" aa "")
 )
 (princ)
)

Since you are defining the filter parameters instead of receiving them from a variable, you can also use:

'((0 . "INSERT")(2 . "SW_Cen*"))

Link to comment
Share on other sites

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