Hi All, I need to explode everything in my drawing. The problem is that our blocks are not that great. We have blocks inside blocks. When my LISP routine executes the explode it explodes all the selected items. But there are still some blocks that exist. So I doubled the explode command, but it doesn't find the new blocks. If I type in explode then all, it still doesn't work. I have to use the mouse and select all the items by a window and then type explode. How can I do this in my LISP routine? Chad -- ________________________________ Cameron Land Surveying Ltd. #203-6333 148 Street Surrey, BC V3S 1C1 (o) (604) 597-3777 (f) (603) 597-3783 All E-Mail Scanned with Norton Anti-Virus
That creates a infinite loop. You'd be better off specifying the types of entities that can be exploded or using the QAFLAGS variable as a work around.
Do you want to explode only blocks or also polylines and mtext? If you only want to explode only block references, then something like this might be better. The filter list could be expanded. ;;Explode all inserts (defun c:xpall () ;;D. C. Broad 2004 (setvar "qaflags" 1) (while (setq ss (ssget "x" (list (cons 0 "insert")))) (command "explode" ss "")) (setvar "qaflags" 0) (princ) )
Why not, (while (setq SS (ssget "ALL")) (command "_explode" SS "") (command "_regen") ) Makes the loop even longer... Bob
Thanks I tried your idea, but it still doesn't work. It says the object is not able to be exploded. It is a simple block. If I click on it and type explode, it works, but everything I try is Lisp doesn't Chad
Hang on, I tried it again, and it worked. So I tried it a couple of times, and it randomly works. ??? Chad
It will error when it finds an item that cannot be exploded..and just exits the loop. Would appear to be random. I like Doug's approach..try that.. Bob
Sigh... Sometimes posting seems to be a waste of time when the person being helped doesn't even notice. Thanks Bob.
OK Doug, I tried your. It appears to do nothing. This is what is displayed on the prompt: C:XPALL all blocks are still blocks. Now what? Chad PS: I did try yours. How do I expand the filter list to include everything?
Here is the complete scenario. We use a different program for our drafting. We have to submit the drawings to the city. They have an exact set of rules. When we export the file to dxf, linetypes, colours, & blocks are messed up. I have done the layer assignments already & the colours, except, that the blocks have lines from other layers, so I have to explode the block so I can change the layers of the lines inside the block. Not everything on the drawing is blocks, I have text, mtext, plines, lines, etc. If I highlight everything and type explode, it will say 10 items found 5 items could not be exploded. So I do it again, then it might say 20 items found, 15 could not be exploded. So I do it again, and it might say 100 items found 100 items could not be exploded. Now I know all items are exploded, and I can select everything and change it so that the colour, linetype are 'bylayer'. I want to be able to do this with a lisp command. Chad ECCAD: your way works occasionally. From what I understand, if it comes across a line it stops the lisp routine because it cannot be exploded. Doug: your did nothing.