@MSA3DY wrote:
(ssget "_X" '((0 . "INSERT"))) , this code is great.
but I want to explode this selection
I made something like this but don't work.
(DEFUN C:xall ()
(ssget "_X" '((0 . "INSERT")))
(COMMAND "explode" "_X" ""))
Your "_X" is a selection mode for use within (ssget), and not valid input for the object-selection in the Explode command. Did you intend to put that selection into a variable? That's an option, but not necessary -- you could do [in simplest terms to do what your code is apparently intended to do] this:
(defun C:XALL ()
(initcommandversion); for following to Explode more than one
(command "_.explode" (ssget "_X" '((0 . "INSERT"))) "")
)
But that doesn't limit itself to the current space in selection -- it will "find" all Blocks in other spaces, too, though it won't Explode them this way [if that's part of what you want to do], because commands involving object selection can "see" only objects in the same space, even though the (ssget) function can reach beyond that. It could be made to get them all, by moving into each space in which such objects are found.
And it doesn't deal with the question of locked Layers.
Kent Cooper, AIA