block delete method not working properly

Discussion in 'AutoCAD' started by Brent, Jul 27, 2003.

  1. Brent

    Brent Guest

    I'm using Acad 2002. I'm iterating through the blocks collection. I perform
    a selection set using group code (2) and the group value of (block name).
    The selection set comes back empty. I perform objBlock.delete and I get an
    error -2145386239 Object is referenced. So I'm assuming that the block is
    being referenced by something else in the drawing, which is fine. However,
    if I run the purge command and expand the blocks category, I see a list of
    all the blocks that I tried to delete/purge in my routine but had received
    an error saying the blocks were referenced. Using the purge dialog, I'm able
    to delete them without the reference error. Something funny is going on.

    Any feed back would be helpful. I know I can use the command line and
    run -purge with the correct parameters but I'm hoping I can get some
    clarification on why vba isn't deleting some of the block definitions. FYI -
    there are some blocks that do get deleted in the routine.

    Thanks,
    Brent
     
    Brent, Jul 27, 2003
    #1
  2. Sounds like the block in question is nested within another block.
     
    Chuck Gabriel, Jul 28, 2003
    #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.