Existance of Handle

Discussion in 'AutoCAD' started by manoj_vest, Jun 10, 2004.

  1. manoj_vest

    manoj_vest Guest

    Hi all,

    I am storing the handle of block references in a drawing. Suppose some body deletes some of the block references. But I has still the handle stored for that reference. So I have handle and I need to know whether the entity corresponding to the handle exist or has been deleted.

    One method of doing this is iterate entire model space, get the handle of each entity and compare with the one desired and see whether the entity exist or not. If not means the entity has been deleted.

    But is there any other direct method to find from a handle whether the entity exist or not.

    Sorry I have narrated too much. I not clear then let me know.

    Manoj
     
    manoj_vest, Jun 10, 2004
    #1
  2. Another method to try: HandleToObject.
     
    Frank Oquendo, Jun 10, 2004
    #2
  3. manoj_vest

    Jürg Menzi Guest

    Hi Manoj

    This will return a trappable error if "AA" doesn't exist:

    Dim TstObj As AcadObject
    Set TstObj = ThisDrawing.HandleToObject("AA")

    Cheers
     
    Jürg Menzi, Jun 10, 2004
    #3
  4. manoj_vest

    JRWalker Guest

    Have you tried the HandleToObject method?

    JRWalker

    body deletes some of the block references. But I has still the handle stored
    for that reference. So I have handle and I need to know whether the entity
    corresponding to the handle exist or has been deleted.
    each entity and compare with the one desired and see whether the entity
    exist or not. If not means the entity has been deleted.
     
    JRWalker, Jun 11, 2004
    #4
  5. manoj_vest

    manoj_vest Guest

    Hi JRWalker,

    Sorry for late response because I was busy in some other work. I tried the same and it is working fine. Thanks for your help

    Manoj
     
    manoj_vest, Jun 14, 2004
    #5
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.