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

Explode Command

32 REPLIES 32
Reply
Message 1 of 33
bmwm3owner
310 Views, 32 Replies

Explode Command

Hello,

I hate it when people explode hatches in my office. Is there a way so that when people go to explode a hatch, it will filter it out.

How can I write an explode routine that will ask you "are you sure you want to explode hatches" before doing so.

I wouldn't mind if when a bunch of stuff was selected, say plines, hatches, what have you, that when the user was done selecting, it would say "X amount of hatchs selected, do you want to explode them?" and if the user said "N" it will continue to explode the non-hatch enities, and if they said "Y", it will explode all.
Thanks
32 REPLIES 32
Message 21 of 33
Anonymous
in reply to: bmwm3owner

> Gave the > boss something to do, and largely kept him out of the real drawings! > Cheers,
Message 22 of 33
Anonymous
in reply to: bmwm3owner

Ask why they explode hatches, train them to do it a better way without exploding. Then if they do it again, repeat above instructions again. and again. Then encourage them to ask before doing it. Then warn them not to do it in writing. Then totally disable EXPLODE and XPLODE commands on their machine and have them beg for it ;) Should take about a week ;) -- Dean Saadallah Add-on products for LT http://www.pendean.com/lt --
Message 23 of 33
bmwm3owner
in reply to: bmwm3owner

Thank You. It works great. You are the man.
Message 24 of 33
Anonymous
in reply to: bmwm3owner

Glad to hear it. I tried to lay out the routine in a way that would 'explain itself' to you. If you want to add a section to ask for approval to explode the hatches, etc, that's easy to do. -doug "sashk" wrote in message news:26509400.1088440838127.JavaMail.jive@jiveforum2.autodesk.com... > Thank You. It works great. You are the man.
Message 25 of 33
bmwm3owner
in reply to: bmwm3owner

Barr-

I added a list of blocks that I do not want to be exploded, but it still explodes them. Also, when an item does explode, like a polyline, it will explode it (good) but it also returns an "unknown command" as well. I attached the file that I added to. Any ideas?? Thanks
Message 26 of 33
bmwm3owner
in reply to: bmwm3owner

thats okay. I will tell them to type in .explode to do that. Can you check the previous post that I just added. It explodes blocks that I have added to the list. Thanks
Message 27 of 33
Anonymous
in reply to: bmwm3owner

Hi Sashk - I looked at your list. The reason it's not working for you is that you're combining 2 categories in the same filter... "DIMENSION" "HATCH" are entity type (assoc 0) "QASECBUB-ATT2" "QACDEBUB-ATT" are names of blocks or hatch types (assoc 2). You'll need to determine what you want to filter for. If you're really interested in protecting just some specific blocknames or hatchnames, you need to change from (setq safelist (list "DIMENSION" "HATCH")) to (setq safelist (list "QASECBUB-ATT2" "QACDEBUB-ATT" ...etc)) and change (setq c (assoc 0 b)) to (setq c (assoc 2 b)) If you want to filter out ALL dimensions and hatches, and SOME blocks, it could be a two-step process... (defun C:EXPLODE ( / sset ssl n a b c d safelist) (setq safetypes (list "DIMENSION" "HATCH")) (setq safenames (list "TICK1" "QADETBUB-ATT" "QADETBUBLDR-ATT" "QAGRDBUB-ATT" "QANOTBUB-ATT" "QASECBUB-ATT" "QASECBUB-ATT2" "QACDEBUB-ATT" "QAHEADJAMB-ATT" "QADORTAG-ATT" "QADORTAG2-ATT" "QARMTAG-ATT" "QAWINTAG-ATT" "DIAMOND-ATT" "SQTAG-ATT" "DELTATAG-ATT" "ELLIPSETAG-ATT" "QAELEVBUB-ATT" "QAKEYTITLE-ATT" "QK-NORTH-ATT")) (princ "\nSelect entities to explode - some entities are protected:") (setq sset (ssget)) (setq ssl (sslength sset)) (setq n ssl) (setq counter 0) (repeat ssl (setq n (1- n)) (setq a (ssname sset n)) (setq b (entget a)) (setq c (assoc 0 b)) (setq d (cdr c)) (setq e (assoc 2 b)) (setq f (cdr e)) (if (not (or (member d safetypes)(member f safenames))) (progn (setq counter (1+ counter)) (command ".explode" a "") ) ) ) (setq protected (- ssl counter)) (princ counter) (princ " entities exploded, ") (princ protected) (princ " entities protected.") (princ) ) I hope you can see what's happening here. -doug "sashk" wrote in message news:15832673.1088443067008.JavaMail.jive@jiveforum2.autodesk.com... > thats okay. I will tell them to type in .explode to do that. Can you check the previous post that I just added. It explodes blocks that I have added to the list. Thanks
Message 28 of 33
Anonymous
in reply to: bmwm3owner

It does return 'unknown command', apparently after it explodes the entity, possibly when it hits the "" following the entity name to be exploded. That "" is to close the selection set and continue with the explode command. But if the "" is deleted, the explode command does not execute. It appears to be simply a report. Setting cmdecho=0 does not make it go away. However, the good news is that the report doesn't stop the explode command. Maybe someone else can tell us why this happens. -doug "sashk" wrote in message news:33320849.1088442962641.JavaMail.jive@jiveforum2.autodesk.com... > when an item does explode, like a polyline, it will explode it (good) > but it also returns an "unknown command" as well.
Message 29 of 33
bmwm3owner
in reply to: bmwm3owner

Thanks Doug. It works. I'll work on the unknown thing.
Message 30 of 33
bmwm3owner
in reply to: bmwm3owner

I noticed one more thing that I tried to get to work....

When I select things like lines, circles, arcs, etc., it still says that they exploded them. I tried to make it filter those things out like how the normal explode command would do, but I messed up. Is there a way when those types of objects are selected, it will filter them out???

Thanks so much for all of your help. This routine is great. It helps to prevent accidental mistakes
Message 31 of 33
Anonymous
in reply to: bmwm3owner

Hi sashk - Lines, circles and arcs cannot be exploded, as you know. You're right -- unless those entities are filtered out, they will be 'added to the count' of entities to be exploded (even though they cannot be exploded). So simply add them to the list of entity types to filter out: (setq safetypes (list "DIMENSION" "HATCH" "LINE" "CIRCLE" "ARC")) and they won't be counted among the entities to be exploded. Same results, different count. -doug by the way, when I call you sashk, I somehow don't think that's your name... care to enlighten me? "sashk" wrote in message news:16772763.1088463619828.JavaMail.javamailuser@localhost... > I noticed one more thing that I tried to get to work.... > > When I select things like lines, circles, arcs, etc., it still says that they exploded them. I tried to make it filter those things out like how the normal explode command would do, but I messed up. Is there a way when those types of objects are selected, it will filter them out??? > > Thanks so much for all of your help. This routine is great. It helps to prevent accidental mistakes
Message 32 of 33
bmwm3owner
in reply to: bmwm3owner

Doug,

People call me Sash because my name (real name) is difficult to pronounce. I was calling you Barr at the beginning, but it took me a few posts to figure out that your name was Doug.

BTW, because my knowledge of lisp is really limited, where do I find a good listing of the associations. The routine looks somewhat simple, but assoc and counters are something that I do not know. Thanks again for all of your help. It has been truly great!
Message 33 of 33
Anonymous
in reply to: bmwm3owner

> BTW, because my knowledge of lisp is really limited, where do I find a good listing of the associations. The routine looks somewhat simple, but assoc and counters are something that I do not know. Thanks again for all of your help. It has been truly great! I've searched high & low for a listing of the asoc values in Acad Help files. A few are noted, but there's no complete listing. Some assoc values are specific to the entity type, and mean something different when the entity is a block rather than a circle, for example. I know that a complete listing of all assoc values, specific to their entity type, is listed in the Lisp Customization Manual which was included in Acad 12's set of books. I have that at home. Perhaps someone here knows where to find that listing. -doug

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

Post to forums  

Autodesk Design & Make Report

”Boost