Find object type went ObjectErased event catch delete object

Discussion in 'AutoCAD' started by facicad, Jun 11, 2004.

  1. facicad

    facicad Guest

    I would like to find witch object user delete in drawing. I use event
    ObjectErased but it give only ObjectID and went i use ObjectIdToObject it do
    nothing, I think is beacause the object is erased. In help of autocad tell
    me " Use the "Object" variable to determine the type of object removed " but
    I don't know wath is this. Can HELP me???
     
    facicad, Jun 11, 2004
    #1
  2. It's pretty obvious that the person who wrote that
    in the documentation didn't either.

    You can't access erased objects, which means that
    there is no way to do it, without using ObjectARX.

    My AcadX library has an Undelete() method, but if
    the object was erased, and you unerase it, and
    then erase it again, it will fire the notification
    again, and you will loop endlessly.

    --
    http://www.caddzone.com

    AutoCAD based Security Planning Solutions:
    http://www.caddzone.com/securityplanning

    AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
    http://www.acadxtabs.com
     
    Tony Tanzillo, Jun 11, 2004
    #2
  3. facicad

    facicad Guest

    I don't want undelete object, I just want if the object is block. If block
    name is specific name, I modify something in drawing. I just want to retrive
    info of object is delete
     
    facicad, Jun 14, 2004
    #3
  4. Maybe you should try creating BeginCommand event and do some pickfirst
    selection set objects checking if the command being started is "ERASE" (user
    picked objects for deletion). Other way round, if user issues ERASE picking
    objects subsequently, there's no viable solution to it than what Tony
    suggested (or maybe there is, but rather complicated one).

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jun 15, 2004
    #4
  5. facicad

    wivory Guest

    Ugly, but perhaps you could iterate all blocks in the drawing before-hand (maybe on load or maybe when in the Begin event) and store the information somewhere, then after the Delete you iterate again and see what's missing!

    (I said it wasn't pretty.)

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Jun 16, 2004
    #5
  6. Wayne,

    The other (ugly) method assumes that you store a copy of pickfirst selection
    set objects' properties to some secure place (say, Dictionary), so in case
    user deletes them you still have an info on what user just erased. Having in
    mind that pickfirst selection set may consist of many many objects, the
    operation of cloning their properties to Dictionary may take considerable
    amount of time... every time he/she picks something on screen... On the
    other hand, you can narrow this operation to preset number of selected
    objects (e.g. 10) to avoid ugly delays and possible fatal errors...

    Regards,
    Maksim Sestic

    (maybe on load or maybe when in the Begin event) and store the information
    somewhere, then after the Delete you iterate again and see what's missing!
     
    Maksim Sestic, Jun 16, 2004
    #6
  7. Excuse me, but kludges like this are just not
    realistic solutions. I've noticed that VBA
    programmers in particular seem to be in the habit
    of gravitating towards, and incorrectly viewing
    hideous kludges like this as feasible. Perhaps
    it is because they're too anxious to solve the
    problem and in that anxiety, they fail to look
    beyond the surface, which is what prevents them
    from seeing why the kludge will not work.

    So, lets look beyond the surface:

    First, the erase command may not use the pickfirst
    selection set.

    Second, there are ways to erase an object without
    using the erase command.

    Third - Undo/Redo has to be considered. If a
    block is inserted and then the user issues the
    UNDO command, the block is effectively erased,
    but there is no object erased notification.





    AutoCAD based Security Planning Solutions:
    http://www.caddzone.com/securityplanning
     
    Tony Tanzillo, Jun 16, 2004
    #7
  8. facicad

    facicad Guest

    facicad, Jun 17, 2004
    #8
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.