williamferenal Posted January 17, 2022 Posted January 17, 2022 Hi. I am a newbie with Lisps. But was just wondering if there is an existing lisp out there to explode all blocks (both model space and paper space) except for blocks in this layer "A3_TT"? I am trying to look for a routine cause I need to apply it to almost thousands of drawings. Any help would be much appreciated. Best regards, William Quote
BIGAL Posted January 17, 2022 Posted January 17, 2022 (edited) For us around a while explode all blocks except some in a 1000 dwg's rings alarm bells, can you please explain more why you need to do just that, there may be a better way. Doing the explode part is like 2 lines of code, a ssget with exclude layer, then explode selection set. (setq ss (ssget "x" ............... (command "explode" ss "") In mean time do a bit of googling about accoreconsole that will process the 1000 dwgs. Edited January 17, 2022 by BIGAL Quote
williamferenal Posted January 17, 2022 Author Posted January 17, 2022 Hi Bigal, Thanks for the reply. I am actually just applying it to 80 to 90 drawings at a time. But we have multiple packages of the same number of drawings hence I mentioned around 1000's. Quote
BIGAL Posted January 17, 2022 Posted January 17, 2022 Can you explain the need to explode the blocks, I typed the 2 lines of code directly to command line and exploded all the blocks I had so that is easy part, I am just not good at ssget and -4 not. Some on will provide. method 1 use a script open dwg and run the explode, disadvantage a bit slow but if dwgs are small suprisingly fast. I ran 100+ did mslide it flashed and buzzed around 15 minutes. method 2 use OBDX and change other dwgs with out opening. OBDX is not the simplest to code. Its lisp. method 3 use accoreconsole this changes dwg's without opening them runs in background, very fast, you can make a BAT file that will do complete directories just looks for .dwg. Hint I use old fashioned Dos to get dwg list of names then put in Notepad++ or word and make a script if doing 50 may be very fast this may not be quite right just a example of a script Open dwg1 (setq ss (ssget "x" ....) explode !ss ; close Y Open dwg2 (setq ss (ssget "x" ....) explode !ss ; close Y Quote
StevJ Posted January 17, 2022 Posted January 17, 2022 (edited) See this thread. Steve Edited January 17, 2022 by StevJ Quote
BIGAL Posted January 17, 2022 Posted January 17, 2022 Lee Mac's post in thread is the ssget syntax required to exclude a layer. Quote
mhupp Posted January 17, 2022 Posted January 17, 2022 (edited) This will explode all block in the drawing in model or paper space that is not on layer A3_TT with a simple ~. (defun C:blkExp (/ SS) (if (setq SS (ssget "_X" '((0 . "INSERT") (8 . "~A3_TT")))) ;the ~ = all layers not A3_TT (foreach ent (mapcar 'cadr (ssnamex SS)) (vla-explode (setq blk (vlax-ename->vla-object ent))) ;works on blocks on other tabs (vla-delete blk) ) ) ) Edited February 12, 2022 by mhupp 2 Quote
williamferenal Posted January 31, 2022 Author Posted January 31, 2022 Guys, apologies for the late reply...had a bit of health issues...anyway mhupp thank you very much for the reply, it worked like a charm... 1 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.