Explode Command & SSGET

Explode Command & SSGET

steelcitymetal
Enthusiast Enthusiast
1,928 Views
3 Replies
Message 1 of 4

Explode Command & SSGET

steelcitymetal
Enthusiast
Enthusiast

If I use:

(command "erase" (ssget) "")

all objects I select are erased.

 

However, if I change it to:

(command "explode" (ssget) "")

only the LAST object that was selected is exploded.

 

What is going on here?  Why is it not exploding all items selected?

 

Edit: The object type I am testing this on are closed polylines.

 

 

 

Obviously I plan on adding more to this, but here is the "full" code which is not exploding all selected objects (only the last object selected):

(defun c:xc()
(command "explode" (ssget) "")
)

 

0 Likes
Accepted solutions (1)
1,929 Views
3 Replies
Replies (3)
Message 2 of 4

Ranjit_Singh
Advisor
Advisor
Accepted solution

There are different command versions that can be invoked. Before calling explode set the command version to 2

(initcommandversion 2)
(command "explode" (ssget) "")
Message 3 of 4

steelcitymetal
Enthusiast
Enthusiast

That works, thanks.

 

To set it back, do I just use (initcommandversion) ?

0 Likes
Message 4 of 4

Ranjit_Singh
Advisor
Advisor

initcommandversion applies only to the command that follows. It should go back to current version right after the command ends. You shouldn't have to do anything.

0 Likes