dbDeleteObject behavior in openAccess

Discussion in 'Cadence' started by SS, Jun 30, 2008.

  1. SS

    SS Guest

    I have a code which would delete some shapes in the layout view if
    they a "certain" property attached to it.
    I use dbDeleteObject to delete them . However dbDeleteObject deletes
    some child objects while deleting parent objects.

    This causes the code to error out (as it tries to delete already
    deleted objects).

    I therefore introduced a check to see if the object exists before
    deleting.

    This is how I do it.
    if(obj the
    printf("the obj is %L\n" obj)
    if(dbGetPropByName(obj "placed") != nil then
    dbDeleteObject(obj)
    )
    dbSave(cvId)
    )


    Howver it prints the object ID (using the print statement) but errors
    out after that saying the object does'nt exist.

    Wyy is this happenning ?

    -SS
     
    SS, Jun 30, 2008
    #1
  2. SS

    S. Badel Guest

    I believe you can use dbIsObj() to test wether the object is valid prior to delete it.

    You can also have a look at errset() to catch errors.

    cheers,
    Stéphane
     
    S. Badel, Jun 30, 2008
    #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.