vla-explode

Discussion in 'AutoCAD' started by UK, Apr 24, 2004.

  1. UK

    UK Guest

    (vla-explode (vlax-ename->vla-object (car (entsel))))

    This code can not explode the block that not equal scale X Y Z.
    Aren't there any good ideas?
     
    UK, Apr 24, 2004
    #1
  2. UK

    Jeff Mishler Guest

    Sure, this will mimmick the ActiveX "explode" method which leaves the
    original item and returns the newly created items, although this returns a
    selection set rather than an array. Tested with R2002

    (if (setq ent (car (entsel))); if user selects something
    (progn
    (setq oldexplmode (getvar "explmode"));; save current setting
    ;;set variable to allow non-uniformly scaled blocks to be exploded
    (setvar "explmode" 1)
    (command "explode" ent "");; explode it
    (setvar "explmode" oldexplmode);; restore saved setting
    (setq exp_objs (ssget "p"));; get the newly created objects
    (entdel ent);; restore original entity
    )
    )

    HTH,
    Jeff
     
    Jeff Mishler, Apr 24, 2004
    #2
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.