ILoveMadoka Posted March 25, 2010 Share Posted March 25, 2010 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! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 25, 2010 Share Posted March 25, 2010 Have you tried? All SelectionSet filter lists can use Wildcards, so as long as you are conversent with them, then the possibilities are endless. Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted March 25, 2010 Author Share Posted March 25, 2010 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! Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 25, 2010 Share Posted March 25, 2010 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*")) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 25, 2010 Share Posted March 25, 2010 No worries, glad you understand Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted March 25, 2010 Author Share Posted March 25, 2010 See! If you don't post YOUR code you can't learn better ways of doing things!! Thanks guys!! Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 25, 2010 Share Posted March 25, 2010 See! If you don't post YOUR code you can't learn better ways of doing things!! Thanks guys!! ......... Quote Link to comment Share on other sites More sharing options...
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.