Author Topic: ObjectID - lifetime ?  (Read 2160 times)

0 Members and 1 Guest are viewing this topic.

rogue

  • Guest
ObjectID - lifetime ?
« on: June 11, 2008, 07:25:08 AM »
I've always used handles. The help file states that handles are always constant through the lifetime of the drawing - the inference being that ObjectID's are not ...

But, to use fields, I need to use the ObjectID's. When could one reasonably expect an ObjectID to change? if it does change, how do you find the original entity that was referenced in the field?

TIA ....

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: ObjectID - lifetime ?
« Reply #1 on: June 11, 2008, 07:57:26 AM »
Handles can and do change with the WBLOCK command. It is my understanding that the ObjectID can change.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: ObjectID - lifetime ?
« Reply #2 on: June 11, 2008, 10:48:00 AM »
...When could one reasonably expect an ObjectID to change?...

Each object in a database is assigned a new ObjectId on opening. The Ids do not change while the database is open.
They are unique across all open databases.

As you have already discovered handles are always constant, but are not guaranteed to be unique across multiple databases.

...But, to use fields, I need to use the ObjectID's....

Why? Since the Field object is derived from DBobject, it should have both a handle and ObjectId property to party with  :-)