Explode Programatically Created Blocks

Discussion in 'AutoCAD' started by ATMyers, Jan 18, 2005.

  1. ATMyers

    ATMyers Guest

    For some reason, with AutoCAD 2005, a program that I wrote under 2000i and 2002 will now no longer work correctly. It fails whenever I try to explode a block I created programatically by adding it to the block definitions table of the drawing and then inserting that block throughout the drawing by name. Any ideas why this might be the case? The program crashes giving an "invalid input" message.
     
    ATMyers, Jan 18, 2005
    #1
  2. Kind of hard to discern without code - post your routine and then maybe we
    can help.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Jan 19, 2005
    #2
  3. ATMyers

    atmyers Guest

    dim insPT(0 to 2) as Double
    dim blockObj as AcadBlock

    insPT(0) = 0#
    insPT(1) = 0#
    insPT(2) = 0#

    'Add the block to the drawing block definitions.
    Set blockObj = ThisDrawing.Blocks.Add(insPT, "LOM_BLOCK")

    'Add some things to the block using blockObj.addLine(...)
    'and blockObj.addText(...)

    Set ObjBlockRef = ThisDrawing.ModelSpace.InsertBlock(insPT, "LOM_BLOCK", Settings.lmScale, Settings.lmScale, #, 0#)

    'Later:

    Dim arrayExpBlock As Variant

    arrayExpBlock = ObjBlockRef.Explode

    The really strange thing is that this works under 2000i and 2002, but not 2005.
     
    atmyers, Jan 21, 2005
    #3
  4. ATMyers

    Jürg Menzi Guest

    Hi atmyers

    Because of a (reported) bug in A2k4/A2k5, explode method will fail
    with NUS blocks.
    Sorry, that's all I've got from A'desk.
    As an alternative, you can use SendCommand Explode...>¦-(

    Cheers
     
    Jürg Menzi, Jan 21, 2005
    #4
  5. ATMyers

    atmyers Guest

    What's an NUS block?
     
    atmyers, Jan 21, 2005
    #5
  6. ATMyers

    atmyers Guest

    Non-uniformly scaled, that did it. All I had to do was change the z-insertion scale to be the same as both the x and the y and it was able to be exploded. Thanks for your help
     
    atmyers, Jan 21, 2005
    #6
  7. ATMyers

    Jürg Menzi Guest

    Welcome...¦-)

    Cheers
     
    Jürg Menzi, Jan 21, 2005
    #7
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.