Explode Command

Discussion in 'AutoCAD' started by sashk, Jun 25, 2004.

  1. sashk

    sashk Guest

    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
     
    sashk, Jun 25, 2004
    #1
  2. sashk

    coachball8 Guest

    coachball8, Jun 25, 2004
    #2
  3. sashk

    Paul Turvill Guest

    First time, a warning. Second time, pink slip.
    ___
     
    Paul Turvill, Jun 25, 2004
    #3
  4. sashk

    Tom Smith Guest

    I tend to favor Paul's view. It's a personnel/training/standards issue. If
    there is an office rule or standard, there should be a process of checking
    for compliance, and enforcing it, without requiring more programming work.

    If there isn't a standard, then it's just an issue of your preference versus
    theirs. Yours may make more sense, but unless you have the authority to
    enforce it, you are just another person arguing. In that case, it isn't
    legitimate for you to force your preferences by a "sneaky" method. It will
    only cause more argument.

    IMHO, CAD customizations should focus mostly on helping cooperative people
    to meet standards more easily and efficiently.
     
    Tom Smith, Jun 25, 2004
    #4
  5. sashk

    Rudy Tovar Guest

    So what happens if a principle does it....

    Although I like your idea...
     
    Rudy Tovar, Jun 25, 2004
    #5
  6. sashk

    sashk Guest

    I saw the routine, but I have 2 questions.

    1. If the "EXPLODE" command was undefined, how, in the routine, did the explode command work if it was already undefined? I see that the new command was called explode, but within the new command that they called "explode" there is the acad version of explode and this is what confuses me

    2. How do I add hatches and dimensions to the list of objects not to be exploded because they mentioned specific block names, and not object types in this routine.

    Thanks
     
    sashk, Jun 25, 2004
    #6
  7. sashk

    Tom Smith Guest

    So what happens if a principle does it....

    Then you can only try gentle persuasion & if that fails you sorta have to
    just get over it :)

    Usually when people explode hatches it's because they don't know a better
    way to make an edit. And they don't understand that they're probably costing
    more time, when someone else needs to work in the file later.

    A principal ought to be responsive to the time-saving argument. Generally
    the better option is to erase and re-do the hatch due to a change in the
    drawing, as opposed to exploding and manually editing the hatch. It's not
    hard to show that the first method is usually faster and easier.
     
    Tom Smith, Jun 25, 2004
    #7
  8. sashk

    Rudy Tovar Guest

    ha...

     
    Rudy Tovar, Jun 25, 2004
    #8
  9. sashk

    Tom Smith Guest

    ha...

    It's not uncommon for the most senior people to be the least CAD proficient.
    :) We used to try the steer the boss toward the more glamorous front-end
    "design" work, which somebody else was going to re-do substantially anyway
    to turn it into CD's. Kept him busy enough with that to keep him mostly out
    of the real CD's.
     
    Tom Smith, Jun 25, 2004
    #9
  10. sashk

    sashk Guest

    okay, I got it to somewhat work for my blocks, but how do I add the following to the code?

    1. Hatches - All of the selected hatches

    2. Dimensions

    3. I do not want it to just allow me to select one object, but allow me to select whatever I want, and then allow for it to see if the list of blocks was added, along with and dimension string or hatch. If it finds X amount of objects, I want it to alert me that "X amount of objects not allowed to be exploded"

    Help. Attached is the code
     
    sashk, Jun 25, 2004
    #10
  11. sashk

    Rudy Tovar Guest

    Now that's funny....

     
    Rudy Tovar, Jun 25, 2004
    #11
  12. sashk

    Tom Smith Guest

    Now that's funny....

    You have to do what you can, it's hard to fire the guy that signs the
    checks!
     
    Tom Smith, Jun 25, 2004
    #12
  13. sashk

    Rudy Tovar Guest

    aint that the truth...

    Whats really bad is having them as your cad manager...
     
    Rudy Tovar, Jun 25, 2004
    #13
  14. sashk

    Barr Guest

    That doesn't look too far off... except for the weekend approaching.

    Instead of just doing an entsel, do an ssget and use a while loop to do them
    all.
    If you do an ssget, you could filter for those entities right from the start,
    and NEVER explode a dim or a hatch.
    -doug


    select whatever I want, and then allow for it to see if the list of blocks was
    added, along with and dimension string or hatch. If it finds X amount of
    objects, I want it to alert me that "X amount of objects not allowed to be
    exploded"
     
    Barr, Jun 25, 2004
    #14
  15. sashk

    sashk Guest

    My problem is that I am not good enough at lisp to understand how to do that. Any ideas??

    Thanks
     
    sashk, Jun 25, 2004
    #15
  16. sashk

    sashk Guest

    maybe to make it easier, if it is a hatch, dimension, or attribute, alert "X enities not allowed to be exploded"
    and the rest of the objects, such as plines, blocks, etc. can then be exploded. how do you write one of those
     
    sashk, Jun 25, 2004
    #16
  17. sashk

    Barr Guest

    Hi sashk -
    Sorry I didn't get a chance to reply during work hours.
    I think this may get you moving in the right direction...

    Please pardon anything which appears to be 'talking down' to you. To be honest,
    I'm no lisp guru either, but I do know how to get some things done; not always
    in the cleanest most elegant way, but it does work. Which is really all we're
    after.

    (defun c:xpl ( / sset ssl n a b c d safelist)
    (setq safelist (list "DIMENSION" "HATCH"))
    ;;; you can add to this list if you want to protect blocks, etc.
    (princ "\nSelect entities to explode - some entity types 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))
    (if (not (member d safelist))
    (progn
    (setq counter (1+ counter))
    (command "explode" a "")
    )
    )
    )
    (setq protected (- ssl counter))
    (princ counter)
    (princ " entities exploded, ")
    (princ protected)
    (princ " entities protected.")
    (princ)
    )

    I tried exploding all unprotected entities en masse, but I believe the 'multiple
    explode' command is a routine of its own, not a true basic Acad command (I may
    be wrong about this, but that's the way it acts). So instead I do them one at a
    time, and you can see watch each explosion as it's executed. Back in the days of
    Acad 10, there was no 'multiple explode'. One had to create a routine similar to
    this.
    I hope it's helpful, or at least gets you (or others) thinking in creative ways.
    -doug
    ps - I think all the other chat about office procedures and drawing standards
    belongs in another discussion group, perhaps cadmanager.


    enities not allowed to be exploded"
    exploded. how do you write one of those
     
    Barr, Jun 26, 2004
    #17
  18. sashk

    Tom Smith Guest

    Hey, Herman! In the strip shopping center work we did there, the front end
    work was pretty harmless. Plunk some boxes on a site plan and see how many
    parking spaces you could get -- basically feasibility studies. It all got
    redone with greater precision anyway if it turned into a real job. Gave the
    boss something to do, and largely kept him out of the real drawings!
     
    Tom Smith, Jun 26, 2004
    #18
  19. sashk

    sashk Guest

    Thank You. It works great. You are the man.
     
    sashk, Jun 28, 2004
    #19
  20. sashk

    Barr Guest

    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
     
    Barr, Jun 28, 2004
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.