Explode - using visual lisp

Discussion in 'AutoCAD' started by Tom Quok, Jan 13, 2004.

  1. Tom Quok

    Tom Quok Guest

    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
     
    Tom Quok, Jan 13, 2004
    #1
  2. Tom Quok

    ECCAD Guest

    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
     
    ECCAD, Jan 13, 2004
    #2
  3. Tom Quok

    Rudy Tovar Guest

    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)
    )
    )
    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Jan 13, 2004
    #3
  4. Tom Quok

    Rudy Tovar Guest

    Small correction.

    (setq cn 0)
    (while (sn (ssname ss cn))
    (setq slist (append slist (list sn))
    cn (1+ cn)
    )
    )
    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Jan 13, 2004
    #4
  5. Tom Quok

    Jeff Mishler Guest

    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)

    --
    John Uhden, Cadlantic/formerly CADvantage


    HTH,
    Jeff
     
    Jeff Mishler, Jan 13, 2004
    #5
  6. Tom Quok

    Rudy Tovar Guest

    Yeah, and it depends on the AutoCAD version you're working on.

    Companies are still on R14.
    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Jan 13, 2004
    #6
  7. Tom Quok

    Paul Turvill Guest

    .... So? John's method works just fine in R14.
    ___
     
    Paul Turvill, Jan 13, 2004
    #7
  8. Tom Quok

    BillZ Guest

    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
     
    BillZ, Jan 13, 2004
    #8
  9. Tom Quok

    Rudy Tovar Guest

    Odd, it didn't work on the one I tested it on....

    I'll retry.
     
    Rudy Tovar, Jan 13, 2004
    #9
  10. Tom Quok

    Rudy Tovar Guest

    Ah!!, now the dumb thing popped up!

    I tested it out 3 times before and it didn't.
     
    Rudy Tovar, Jan 13, 2004
    #10
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.