coombsie111 Posted November 28, 2014 Share Posted November 28, 2014 Hello all readers, New to all this and not very knowledgable when it comes to lisp, macros etc.... but appreciate their awesome power and have managed to *******ise (please excuse the language) some from my previous company and put them to good use. But thats enough prattling and lets get down to brass tacks. I like to use the FILTER command to select objects, i.e bylayer, blockname , text content etc... and find them very useful. I have used the SaveAs function to collate many of the useful ones that I may need to use on future occassions. My problem is that I would like to use this FILTER command in a LISP routine, but dont know how (or even if) I can suppress the window from opening. (Prefixed hyphen does not work) i.e If I wanted to erase all text with BH in it, I would want to create one fluid LISP (& button) to complete this task and not some piecemeal version. At this point in time I dont have a specific LISP routine in mind, but I have some ideas that it may be of great use on. Any help would be much appreciated. Thank you.. Kind regards Mr C Quote Link to comment Share on other sites More sharing options...
ttray33y Posted November 29, 2014 Share Posted November 29, 2014 sample (defun c:aba () (setq mySet2 (ssget "x" '((2 . "blockname") - add more DXF codes here -))) (command "SELECT" mySet2 "P" "") (princ) ) dxf codes: http://www.afralisp.net/reference/dxf-group-codes.php Quote Link to comment Share on other sites More sharing options...
coombsie111 Posted November 29, 2014 Author Share Posted November 29, 2014 ttray33y, Thanks for your help, but I dont understand - can you ellaborate, perhaps provide an example. Is this related to FILTERS command - can I invoke one of my Saved filters by name? or a different way of achieving the same end? Please confirm.. PS: Apologies for novice head Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 30, 2014 Share Posted November 30, 2014 SSGET is lisp version of get objects and you can use filters, 1st part is object picking "X" means search all dwg you can use window options also WP CP W plus others F, then you can use a filter based on the dxf codes for a particular object looking for a block 0 = "INSERT" 8=layername 10=insertion point, check help it describes a number of combinations. For the dxf codes have a look at the screen after copy tiny lisp to command line and pick object (entget (car (entsel))) If you wanted different type of objects in one filter you can use combinations like (8 , "layer1,layer2,layer3") (8 . "Layer*") all layers starting with "layer" or in simple method you can join selection sets together. You could make a series of little defuns that are your favourite searches. in combination with what you want to do. Re text with BH to be deleted. (setq ss (ssget "x" '((2 . "Text")) then you need a defun search each text and delete if it has BH in it. For delete try Lee-mac.com for "search text string.lsp". Quote Link to comment Share on other sites More sharing options...
coombsie111 Posted November 30, 2014 Author Share Posted November 30, 2014 Wow, Alot to take in... thanks BigAl. I will give this a go next week and let you know how I get on. Kind regards Mr C 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.