Explode - using visual lisp

Tom Quok

Usenet Archive
Joined
Jan 7, 2004
Messages
13
Reaction score
0
When I tried the following code, it only "explode" one block when "sched_blk" contains many blocks. What am I doing wrong

(setq sched_blk (ssget "x"
'((0 . "insert")
(-4 . "<or")
(2 . "*Note*")
(2 . "*Types*")
(2 . "*Specs*")
(-4 . "or>")
)
)
)
(command "_explode" sched_blk "")

Tom
 
Unfortunately, Explode only explodes the selection set or Block selected. One explode will un-nest the 'top' level, creating seperate elements. You have to 're-select' the resultant elements and do another explode.
Bob
 
You have to explode each entity by name.

Create a list of entity names within the selection, and then foreach or while explode each entity block.

(setq cn 0)
(while (ssname ss cn)
(setq slist (append slist (list (ssname ss cn)))
cn (1+ cn)
)
)
 
Small correction.

(setq cn 0)
(while (sn (ssname ss cn))
(setq slist (append slist (list sn))
cn (1+ cn)
)
)
 
Or, as posted by John Uhden back in 2002:

If you want to explode a selection set, (setvar "qaflags" 1)(command ".explode" ss "")(setvar "qaflags" 0)
 
Yeah, and it depends on the AutoCAD version you're working on.

Companies are still on R14.
 
If your qaflags variable is set to 0 explode will only do one block or one pline in a selction set. Set qaflags to 1, then try again.

(command "_explode" sched_blk "")

Bill
 
Ah!!, now the dumb thing popped up!

I tested it out 3 times before and it didn't.
 

Latest threads

Back
Top