Can I delete an object in event handler

Discussion in 'AutoCAD' started by Stanley, Jan 14, 2005.

  1. Stanley

    Stanley Guest

    Hi everybody,

    I'm trying to write an event handler to edit block attributes while user

    double-clicked specific type of block.

    Within the double-click event handler, I access the block by using the

    Pickfirst selection set, then check the object type that match what I want.

    For example a Block named "CAP SCREW" have 4 attributes:
    NO , REMARK, LENGTH, BORE_DEPTH.

    But because there may be some block with old definition which just have

    the 1st 2 attributes. In this case I need to redefine the block and then
    insert

    a newly defined block at the same position. Finally the old block needs to

    be deleted.

    **** NOW I HAVE THE PROBLEM TO DELETE THE OLD BLOCK

    WITHIN THE EVENT HANDLER ****

    Can anyone teach me how to solve the problem.

    Or even don't have to delete the old block, may be there is a way to
    redefine

    my existing block but I don't know.
     
    Stanley, Jan 14, 2005
    #1
  2. Stanley

    Danny P. Guest

    I'm not sure you can do this. You can't delete an object that fired an
    event. Have you considered just updating all the blocks?

    Hope that helps,
    Danny Polkinhorn
    WATG
    Honolulu
     
    Danny P., Jan 15, 2005
    #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.