Object Handles

Object Handles

Anonymous
Not applicable
386 Views
12 Replies
Message 1 of 13

Object Handles

Anonymous
Not applicable
Hello,
How does one change an object's handle? I'm not looking for a how-to
explanation, just a general explanation. I thought object handles were
assigned to an object and that was it- no changing them. Is this possible?
Generally speaking, should information be linked to object handles or is
this bad practice?

Thanks,
Scott
0 Likes
387 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable
The online helps states: "A handle is persistent (stays the same) in a
drawing for the lifetime of the object." Based on that, I would guess that
changing a handle, if possible, is probably not a good idea. On the flip
side, it sounds like an ideal key when used in conjunction with the drawing
name.

--
Attitudes are contagious. Is yours worth catching?
http://www.acadx.com

"Scott" wrote in message
news:CECB46DB432A6B4B595F00687576B1D5@in.WebX.SaUCah8kaAW...
> Hello,
> How does one change an object's handle? I'm not looking for a how-to
> explanation, just a general explanation. I thought object handles were
> assigned to an object and that was it- no changing them. Is this possible?
> Generally speaking, should information be linked to object handles or is
> this bad practice?
>
> Thanks,
> Scott
>
0 Likes
Message 3 of 13

Anonymous
Not applicable
Scott,

The Handle property is a read-only string that is persistent as long as the
object exist within a given session. It is unclear if it is persistent
between session although initial testing would indicate that it does.
--
Joe Sutphin
Author of "AutoCAD 2000 VBA Programmers Reference"
ISBN #1861002564

Checkout Sources - The magazine dedicated to AutoCAD customization
http://vbdesign.hypermart.net/sources/sources.htm

"Scott" wrote in message
news:CECB46DB432A6B4B595F00687576B1D5@in.WebX.SaUCah8kaAW...
> Hello,
> How does one change an object's handle? I'm not looking for a how-to
> explanation, just a general explanation. I thought object handles were
> assigned to an object and that was it- no changing them. Is this possible?
> Generally speaking, should information be linked to object handles or is
> this bad practice?
>
> Thanks,
> Scott
>
0 Likes
Message 4 of 13

Anonymous
Not applicable
That's a very good point. Just shooting from the hip, I would guess that a
handle is persistent between drawing sessions because it is stored in the
entity's definition data.

--
Attitudes are contagious. Is yours worth catching?
http://www.acadx.com

"Joe Sutphin" wrote in message
news:307F34580B3482D0D9BFC1DA1769CB80@in.WebX.SaUCah8kaAW...
> Scott,
>
> The Handle property is a read-only string that is persistent as long as
the
> object exist within a given session. It is unclear if it is persistent
> between session although initial testing would indicate that it does.
0 Likes
Message 5 of 13

Anonymous
Not applicable
Unlike window handles, object handles do hang around between sessions 🙂 I
hear an echo,,, handle,,,,objectid,,,,,handle,,,,,objectid
-Josh

Frank Oquendo wrote:

> That's a very good point. Just shooting from the hip, I would guess that a
> handle is persistent between drawing sessions because it is stored in the
> entity's definition data.
>
> --
> Attitudes are contagious. Is yours worth catching?
> http://www.acadx.com
>
> "Joe Sutphin" wrote in message
> news:307F34580B3482D0D9BFC1DA1769CB80@in.WebX.SaUCah8kaAW...
> > Scott,
> >
> > The Handle property is a read-only string that is persistent as long as
> the
> > object exist within a given session. It is unclear if it is persistent
> > between session although initial testing would indicate that it does.
0 Likes
Message 6 of 13

Anonymous
Not applicable
If I remember correctly, an ObjectId is unique within a given sesion but
it's transient while a handle is unique only within its drawing and
permanent. Is that correct?

--
Attitudes are contagious. Is yours worth catching?
http://www.acadx.com

"Minkwitz Design" wrote in message
news:39AD5997.7FC77081@minkwitz-design.com...
> Unlike window handles, object handles do hang around between sessions 🙂 I
> hear an echo,,, handle,,,,objectid,,,,,handle,,,,,objectid
> -Josh
0 Likes
Message 7 of 13

Anonymous
Not applicable
Right on the nose 🙂 You can have two objects with identical id's in different
drawings, but those same objects can and most probably will have a different id
the next time you open the drawing, even if you haven't restarted acad.

Frank Oquendo wrote:

> If I remember correctly, an ObjectId is unique within a given sesion but
> it's transient while a handle is unique only within its drawing and
> permanent. Is that correct?
>
> --
> Attitudes are contagious. Is yours worth catching?
> http://www.acadx.com
>
> "Minkwitz Design" wrote in message
> news:39AD5997.7FC77081@minkwitz-design.com...
> > Unlike window handles, object handles do hang around between sessions 🙂 I
> > hear an echo,,, handle,,,,objectid,,,,,handle,,,,,objectid
> > -Josh
0 Likes
Message 8 of 13

Anonymous
Not applicable
"Joe Sutphin" writes:

> The Handle property is a read-only string that is persistent as long as the
> object exist within a given session. It is unclear if it is persistent
> between session although initial testing would indicate that it does.

It's persistant between drawing sessions and it's
never reused. Once a handle is used it's discarded
forever.

It's somewhere on the acad docs (can't read them
rigth now 🙂

--

Eduardo Muñoz

Debian GNU/Linux 2.2
0 Likes
Message 9 of 13

Anonymous
Not applicable
Not exactly should what you are getting at with this response. As I stated,
the Handle property is a read-only string that is assigned to an entity when
it is created. That handle stays with that entity until that entity is
destroyed either in the current AutoCAD session or a session that happens 6
months from now.

Joe

Eduardo Muñoz wrote in message
news:878ztemlav.fsf@localhost.localdomain...
> "Joe Sutphin" writes:
>
> > The Handle property is a read-only string that is persistent as long as
the
> > object exist within a given session. It is unclear if it is persistent
> > between session although initial testing would indicate that it does.
>
> It's persistant between drawing sessions and it's
> never reused. Once a handle is used it's discarded
> forever.
>
> It's somewhere on the acad docs (can't read them
> rigth now 🙂
>
> --
>
> Eduardo Muñoz
>
> Debian GNU/Linux 2.2
0 Likes
Message 10 of 13

Anonymous
Not applicable
The underlying data of an ObjectId is the memory address of the actual
AutoCAD object. So, ObjectIds are unique per session and within a given
session they are even unique across databases. Since the datum is a memory
address, it may or may not be the same from session to session, but you
should definitely not count on it being the same from session to session.

Handles are 64-bit integers that are issued for each object as it is added
to the database. The HANDSEED system variable (stored in the database)
contains the next available handle value and is incremented each time a
handle is issued. So, handles are unique per object in a given database.
They are not unique between databases. They are persistent between
sessions.

"Frank Oquendo" wrote in message
news:A07EAC4B3C04E81B2C4B453186580922@in.WebX.SaUCah8kaAW...
> If I remember correctly, an ObjectId is unique within a given sesion but
> it's transient while a handle is unique only within its drawing and
> permanent. Is that correct?
>
> --
> Attitudes are contagious. Is yours worth catching?
> http://www.acadx.com
>
> "Minkwitz Design" wrote in message
> news:39AD5997.7FC77081@minkwitz-design.com...
> > Unlike window handles, object handles do hang around between sessions 🙂
I
> > hear an echo,,, handle,,,,objectid,,,,,handle,,,,,objectid
> > -Josh
>
0 Likes
Message 11 of 13

Anonymous
Not applicable
Most excellent. Thank you for that information, Art. I'll be sure to tuck it
away for future refrence.

--
Attitudes are contagious. Is yours worth catching?
http://www.acadx.com

Art Cooney wrote in message
news:9C5D2A0AE8DCA4CEE743CA985A11CD9B@in.WebX.SaUCah8kaAW...
> The underlying data of an ObjectId is the memory address of the actual
> AutoCAD object. So, ObjectIds are unique per session and within a given
> session they are even unique across databases. Since the datum is a
memory
> address, it may or may not be the same from session to session, but you
> should definitely not count on it being the same from session to session.
>
> Handles are 64-bit integers that are issued for each object as it is added
> to the database. The HANDSEED system variable (stored in the database)
> contains the next available handle value and is incremented each time a
> handle is issued. So, handles are unique per object in a given database.
> They are not unique between databases. They are persistent between
> sessions.
0 Likes
Message 12 of 13

Anonymous
Not applicable
"Joe Sutphin" writes:

> Not exactly should what you are getting at with this response. As I stated,
> the Handle property is a read-only string that is assigned to an entity when
> it is created. That handle stays with that entity until that entity is
> destroyed either in the current AutoCAD session or a session that happens 6
> months from now.

Well, you didn't stated that in this post. *You* wrote:

> > > [...] It is unclear if it is persistent
> > > between session although initial testing would indicate that it does.

So I wrote:

> > It's persistant between drawing sessions and it's
> > never reused.

It's cristal clear.

BTW, don't send me unsolicited mail again.
Thanks

--

Eduardo Muñoz

Debian GNU/Linux 2.2
0 Likes
Message 13 of 13

Anonymous
Not applicable
It's confirmed - an objects Handle is persistent between AutoCAD sessions.

Joe

"Frank Oquendo" < > wrote in message
news:A07EAC4B3C04E81B2C4B453186580922@in.WebX.SaUCah8kaAW...
> If I remember correctly, an ObjectId is unique within a given sesion but
> it's transient while a handle is unique only within its drawing and
> permanent. Is that correct?
>
> --
> Attitudes are contagious. Is yours worth catching?
> http://www.acadx.com
>
> "Minkwitz Design" wrote in message
> news:39AD5997.7FC77081@minkwitz-design.com...
> > Unlike window handles, object handles do hang around between sessions 🙂
I
> > hear an echo,,, handle,,,,objectid,,,,,handle,,,,,objectid
> > -Josh
>
0 Likes