Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

explode autolisp shortcut

7 REPLIES 7
Reply
Message 1 of 8
jnorris68
757 Views, 7 Replies

explode autolisp shortcut

I have a shortcut lisp command that I've used for years but since upgrading to 2009, it doesn't work the same.

the code is:
(defun c:ex() (command "explode"))

when I use this shortcut to explode, I have to pick single objects where before I was able to select with a crossing window. If I type the entire explode command, it works as before with the window. Other similar shortcut commands I have don't have this issue.

any help is greatly appreciated. I'm not an autolisp expert, this is from an autolisp setup used at the company I work for.

thank you!
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: jnorris68

jnorris68 wrote:
> I have a shortcut lisp command that I've used for years but since upgrading to 2009, it doesn't work the same.
>
> the code is:
> (defun c:ex() (command "explode"))
>
> when I use this shortcut to explode, I have to pick single objects where before I was able to select with a crossing window. If I type the entire explode command, it works as before with the window. Other similar shortcut commands I have don't have this issue.
>
> any help is greatly appreciated. I'm not an autolisp expert, this is from an autolisp setup used at the company I work for.
>
> thank you!

Why don't you just define a keyboard alias in your acad.pgp file and do
away with the lisp shortcut? Then whenever you type EX it starts the
standard EXPLODE command...
Dave
DDP
Message 3 of 8
Kent1Cooper
in reply to: jnorris68

There's already a standard shortcut for that, even quicker than yours [for me in ADT2004, at least] -- just "x". Is there some reason not to use that?

--
Kent Cooper
Kent Cooper, AIA
Message 4 of 8
jnorris68
in reply to: jnorris68

because both of those solutions would be too easy, and I'm an old dog. Seriously, that did the trick. I'd never used the pgp file before but just did. I'll have to retrain to quit using the 'e' Thanks for your help!
Message 5 of 8
scot-65
in reply to: jnorris68

Can I add something?

XX for me is explode.
X can be used as PROPERTIESCLOSE, LINE, XLINE, or any other frequently used command that is not favored on the left side of the keyboard.

EX is a separate program that basically explodes a block and sets all it's entities to the layer the block was placed on.
For most of us, exploding a block leaves all objects onto layer 0.

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 6 of 8
arcticad
in reply to: jnorris68

All that is too easy

{code}
(defun c:EX ()
(setq ss (ssget))
(if (> (sslength ss) 0)
(command "explode" ss)
)
)
{code}
---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 7 of 8
Kent1Cooper
in reply to: jnorris68

[Provided you set the mysterious QAFLAGS System Variable first, because Explode in a (command) function can't do a whole selection set's worth of objects at once, otherwise. Search the Discussion Group for examples, and be sure to set it back!]

If you still think it's too easy, maybe you should also incorporate *more* stuff, such as this:

(setq ss (ssget '((0 . "INSERT,*POLYLINE,MLINE,LEADER,MTEXT,DIMENSION,3DSOLID,BODY"))))

and whatever other object types are explodable, so it will see only those, and ignore unexplodable things like Lines and Text and so on.

--
Kent Cooper

Edited by: Kent1Cooper on Oct 29, 2009 11:07 PM
Kent Cooper, AIA
Message 8 of 8
arcticad
in reply to: jnorris68

All I meant was using X was too easy of a solution.
This seems to filter out non Explodable objects.
as mentioned here.
http://blog.jtbworld.com/2008/07/explode-multiple-objects-with-autolisp.html

{code}
(DEFUN xref_errortrap (errmsg)
(SETQ *error* temperr)
(if (not(= nil qaflags))
(SETVAR "qaflags" qaflags)
)
(PRINC)
)

(defun c:EX ()
(SETQ temperr *error*)
(SETQ *error* xref_errortrap)
(setq qaflags (getvar "qaflags"))
(setvar "qaflags" 1)
(command "._explode" (ssget) "")
(SETVAR "qaflags" qaflags)
)
{code} Edited by: arcticad on Oct 29, 2009 11:51 PM
---------------------------



(defun botsbuildbots() (botsbuildbots))

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report