@BIMadmin wrote:
....
I think that my problem is that I cannot explode hatches through a script or lsp, am I right???
You can, BUT:
I knew that you can't Explode more than one thing together with an Explode command in an AutoLisp (command) function -- it will do only one unless you go through some hoops [do a SEARCH for discussions about the undocumented "QAFLAGS" System Variable]. I didn't expect the same would be true in a Script, but in a quickie test, apparently it is! I think you'll find that your Script Explodes one of the objects, though whether it's the latest one drawn, or the first one, or it chooses by some other criteria, I couldn't say.
You can change the QAFLAGS setting to let it Explode multiple objects at once, being sure to set it back again, or you can do a Lisp routine that will do it without changing that, by finding everything Explodable and stepping through the selection, Exploding them one at a time. The latter is safer, because of the problems that can result if QAFLAGS doesn't get set back [again, see the threads you'll find with a Search], but I don't think it can be done in a Script -- it would require AutoLisp. There are probably several Lisp routines on these Forums already that Explode multiple objects that way, and you would only need to adjust the way the selection is made to pick everything [or filter for just Explodable entity types, so it doesn't need to step through everything in the drawing].
Because [assuming you leave QAFLAGS alone] Explode within a (command) function does only one object, it does not want that extra Enter to complete the selection -- the allowable selection is complete with one entry. That additional Enter is therefore extraneous, which may be what's causing your Purge command to fail, but look over the Command-line history -- it may be obvious.
Kent Cooper, AIA