<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best object for automatic creation: Xrecord or Xdata in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664081#M65955</link>
    <description>i'm still a beginner in this and only a part time programmer, so i really &lt;BR /&gt;
appreciate your WILL to anwser Tony&lt;BR /&gt;
but i still think you might be wrong and file name in this context is &lt;BR /&gt;
useless!&lt;BR /&gt;
&lt;BR /&gt;
for example - try to look at document manager opened files, and open same &lt;BR /&gt;
file several times. i may be doing something wrong but all i can rely is &lt;BR /&gt;
(document).gethascode, not filename itself&lt;BR /&gt;
&lt;BR /&gt;
and, all being said - the only thing that is left - is to hope that autocad &lt;BR /&gt;
will not (by chance) give same handle to copied object (being pasted without &lt;BR /&gt;
ours app running in that session, since if it is in our session then one can &lt;BR /&gt;
track it by objectid)&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6375103@discussion.autodesk.com...&lt;BR /&gt;
No, by 'filename' I mean the full path to the file, not just&lt;BR /&gt;
the file's name.&lt;BR /&gt;
&lt;BR /&gt;
If the file is moved, then the database would have to be&lt;BR /&gt;
updated.&lt;/TONY.TANZILLO&gt;</description>
    <pubDate>Sun, 25 Apr 2010 10:07:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-04-25T10:07:08Z</dc:date>
    <item>
      <title>Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664064#M65938</link>
      <description>I've been trying to find a solution to a problem.  We have with moving a lot of our drawings into AutoCAD from another program, and the biggest concern we have is unique identifiers.  Basically, we have blocks that each represent a specific object in the drawing that, later, need to be unique for a particular building and ALWAYS be unique.  We have an automated program that, once I find a solution for, should take these objects and save their data off into a database somewhere else to track these objects, their properties, ect.&lt;BR /&gt;
&lt;BR /&gt;
Currently, I'm looking at the handles of these objects and exporting the handles as the unique identifier.  However, extra data might need to be added to these at the creating of the objects.  Example: someone goes into the drawing and needs to add a new object.  The desired effect would be that they draw the object or block out and save it.  Once done being drawn, they attach some type of added object to it that would allow them to input data for that object.  Either that, or have the data inputed before the can actually draw it.&lt;BR /&gt;
&lt;BR /&gt;
I need help determining what the best way to store uniquie object data is.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Sat, 10 Apr 2010 12:57:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664064#M65938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-10T12:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664065#M65939</link>
      <description>Each object will have a unique handle that is only applicable to the current drawing., as soon as it is exported or imported into another drawing the handle will change. &lt;BR /&gt;
&lt;BR /&gt;
You would need to store this information in some kind of database to track them across drawing,&lt;BR /&gt;
&lt;BR /&gt;
You also going to have to deal with an object that is new or copied. You may want to run some initialization routine on new objects. &lt;BR /&gt;
&lt;BR /&gt;
As far as I know, the events won't distinguish between a new item and copied item. &lt;BR /&gt;
&lt;BR /&gt;
Having a record of initialization stored in the object may be of benefit.</description>
      <pubDate>Sat, 10 Apr 2010 18:24:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664065#M65939</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2010-04-10T18:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664066#M65940</link>
      <description>-object id is the same for each object, but (i think) objects are &lt;BR /&gt;
renumerated every time autocad opens drawing&lt;BR /&gt;
-object handle is the same always for each single unit object, and every &lt;BR /&gt;
time as long they are in the same drawing&lt;BR /&gt;
&lt;BR /&gt;
not fully understand your project or problems, but i'm about to deal with &lt;BR /&gt;
this myself soon, and this is how i planed it:&lt;BR /&gt;
-user creates object, my program does his things and saves result in objects &lt;BR /&gt;
xrecord, and first xrecord data value will be objects graphic handle&lt;BR /&gt;
-also, i add to object xdata application name for later getting selection &lt;BR /&gt;
set&lt;BR /&gt;
&lt;BR /&gt;
-every object in drawing is my and ok only if handle in xrecord is same as &lt;BR /&gt;
actual handle (if not, it is pasted object)&lt;BR /&gt;
-if it pass this test, then i read rest of xrecord and use my data&lt;BR /&gt;
-if i want to import new objects, then in check this in original drawing, &lt;BR /&gt;
copy them in new and write new xrecord handle&lt;BR /&gt;
&lt;BR /&gt;
potential problem with this - what if i only have 2 objects in file&lt;BR /&gt;
first drawing: 2 objects, first has handle A, second handle B&lt;BR /&gt;
paste in new drawing second object, but autocad gives it handle A?&lt;BR /&gt;
is this scenario possible?&lt;BR /&gt;
&lt;BR /&gt;
also, if part of your question was xrecord od xdata?&lt;BR /&gt;
well, as i see it, xdata is usefull for xdata filtering selection only&lt;BR /&gt;
xrecord, dictionary can hold more data&lt;BR /&gt;
&lt;BR /&gt;
-keep in mind - i'm still an amater, just few month in this</description>
      <pubDate>Sat, 10 Apr 2010 19:29:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664066#M65940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-10T19:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664067#M65941</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
In my knowledge, handles are unique inside a dwg,  each object will have a &lt;BR /&gt;
different handle inside a single dwg database, and also handles are &lt;BR /&gt;
persistent, meaning that the handle will be saved with the dwg. By other &lt;BR /&gt;
side, objectIds are unique to a session, meaning that in a single session &lt;BR /&gt;
will not be 2 objects with the same objectId, no matter the dwg database, &lt;BR /&gt;
but they are not persistent.&lt;BR /&gt;
&lt;BR /&gt;
Finally if you need to store data in an external database, the pair &lt;BR /&gt;
handle,dwgfileName will be a key.&lt;BR /&gt;
&lt;BR /&gt;
-gnb&lt;BR /&gt;
&lt;BR /&gt;
"ljb" &lt;NOTMY&gt; wrote in message &lt;BR /&gt;
news:6370820@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt; -object id is the same for each object, but (i think) objects are &lt;BR /&gt;
&amp;gt; renumerated every time autocad opens drawing&lt;BR /&gt;
&amp;gt; -object handle is the same always for each single unit object, and every &lt;BR /&gt;
&amp;gt; time as long they are in the same drawing&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; not fully understand your project or problems, but i'm about to deal with &lt;BR /&gt;
&amp;gt; this myself soon, and this is how i planed it:&lt;BR /&gt;
&amp;gt; -user creates object, my program does his things and saves result in &lt;BR /&gt;
&amp;gt; objects xrecord, and first xrecord data value will be objects graphic &lt;BR /&gt;
&amp;gt; handle&lt;BR /&gt;
&amp;gt; -also, i add to object xdata application name for later getting selection &lt;BR /&gt;
&amp;gt; set&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; -every object in drawing is my and ok only if handle in xrecord is same as &lt;BR /&gt;
&amp;gt; actual handle (if not, it is pasted object)&lt;BR /&gt;
&amp;gt; -if it pass this test, then i read rest of xrecord and use my data&lt;BR /&gt;
&amp;gt; -if i want to import new objects, then in check this in original drawing, &lt;BR /&gt;
&amp;gt; copy them in new and write new xrecord handle&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; potential problem with this - what if i only have 2 objects in file&lt;BR /&gt;
&amp;gt; first drawing: 2 objects, first has handle A, second handle B&lt;BR /&gt;
&amp;gt; paste in new drawing second object, but autocad gives it handle A?&lt;BR /&gt;
&amp;gt; is this scenario possible?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; also, if part of your question was xrecord od xdata?&lt;BR /&gt;
&amp;gt; well, as i see it, xdata is usefull for xdata filtering selection only&lt;BR /&gt;
&amp;gt; xrecord, dictionary can hold more data&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; -keep in mind - i'm still an amater, just few month in this&lt;/NOTMY&gt;</description>
      <pubDate>Sun, 11 Apr 2010 05:23:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664067#M65941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-11T05:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664068#M65942</link>
      <description>so, you say - if i have 5 opened documents with 2 objects per doc, i have 5 &lt;BR /&gt;
x 2 = 10 unique objectids in autocad at once?&lt;BR /&gt;
but also, can it happen that i also have 5  x 2 &amp;lt;&amp;gt; 10 unique handles?&lt;BR /&gt;
&lt;BR /&gt;
"Gaston Nunez" &lt;GASTON.NUNEZ&gt; wrote in message &lt;BR /&gt;
news:6370886@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
In my knowledge, handles are unique inside a dwg,  each object will have a&lt;BR /&gt;
different handle inside a single dwg database, and also handles are&lt;BR /&gt;
persistent, meaning that the handle will be saved with the dwg. By other&lt;BR /&gt;
side, objectIds are unique to a session, meaning that in a single session&lt;BR /&gt;
will not be 2 objects with the same objectId, no matter the dwg database,&lt;BR /&gt;
but they are not persistent.&lt;BR /&gt;
&lt;BR /&gt;
Finally if you need to store data in an external database, the pair&lt;BR /&gt;
handle,dwgfileName will be a key.&lt;/GASTON.NUNEZ&gt;</description>
      <pubDate>Sun, 11 Apr 2010 17:10:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664068#M65942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-11T17:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664069#M65943</link>
      <description>Both cases are different:&lt;BR /&gt;
&lt;BR /&gt;
First case: objectIds, are always unique in a session, no matter how many &lt;BR /&gt;
dwg databases are opened in the same session. The objectIds are not &lt;BR /&gt;
persistent, meaning that the next time (new session) the same dataset (dwg &lt;BR /&gt;
files) be opened, the objectIds will be different for the same entities.&lt;BR /&gt;
&lt;BR /&gt;
Second case: handles, may be or may be not  unique across multiple dwg &lt;BR /&gt;
databases opened in a single session, what it's granted is that handles are &lt;BR /&gt;
unique inside a single dwg database. So it's perfectly possible to have 2 &lt;BR /&gt;
objects  from distinct dwg databases with the same handle. Handles are saved &lt;BR /&gt;
to the dwg file.&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure what are you trying to do, but if you need to store and &lt;BR /&gt;
identify AutoCAD entities in a database, a combination of handle and &lt;BR /&gt;
dwgFileName conform a unique key for an entity.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-gnb&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"ljb" &lt;NOTMY&gt; wrote in message &lt;BR /&gt;
news:6370926@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt; so, you say - if i have 5 opened documents with 2 objects per doc, i have &lt;BR /&gt;
&amp;gt; 5 x 2 = 10 unique objectids in autocad at once?&lt;BR /&gt;
&amp;gt; but also, can it happen that i also have 5  x 2 &amp;lt;&amp;gt; 10 unique handles?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Gaston Nunez" &lt;GASTON.NUNEZ&gt; wrote in message &lt;BR /&gt;
&amp;gt; news:6370886@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt; Hi,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; In my knowledge, handles are unique inside a dwg,  each object will have a&lt;BR /&gt;
&amp;gt; different handle inside a single dwg database, and also handles are&lt;BR /&gt;
&amp;gt; persistent, meaning that the handle will be saved with the dwg. By other&lt;BR /&gt;
&amp;gt; side, objectIds are unique to a session, meaning that in a single session&lt;BR /&gt;
&amp;gt; will not be 2 objects with the same objectId, no matter the dwg database,&lt;BR /&gt;
&amp;gt; but they are not persistent.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Finally if you need to store data in an external database, the pair&lt;BR /&gt;
&amp;gt; handle,dwgfileName will be a key.&lt;/GASTON.NUNEZ&gt;&lt;/NOTMY&gt;</description>
      <pubDate>Sun, 11 Apr 2010 18:02:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664069#M65943</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-11T18:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664070#M65944</link>
      <description>Well, this does confirm what I've been thinking for a while about this problem.  Things will have to be a composite key between DWG and handle.  Storing the handle into Xrecord of objects would be the next good idea?&lt;BR /&gt;
&lt;BR /&gt;
The idea here, or the project I'm working on, is still in it's beginning phase, so this is just trying to flesh out ideas and solutions for those ideas.  I think it should be possible to do this with handles.  One question I have from this is: is there another way to key the drawing rather then the drawing name?  Does the dwg itself have a key or handle, or am I relying on the name.  My first reaction would be, only name.</description>
      <pubDate>Mon, 12 Apr 2010 11:17:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664070#M65944</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-12T11:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664071#M65945</link>
      <description>What many do is use a data table that stores both&lt;BR /&gt;
the DWG filename keyed to a unique identifier that&lt;BR /&gt;
can be nothing more than a integer.&lt;BR /&gt;
&lt;BR /&gt;
That table can be used to lookup the filename so&lt;BR /&gt;
it doesn't have to be stored with each handle.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;CRYSTALBLUEJOSH&gt; wrote in message news:6371079@discussion.autodesk.com...&lt;BR /&gt;
Well, this does confirm what I've been thinking for a while about this problem. &lt;BR /&gt;
Things will have to be a composite key between DWG and handle.  Storing the &lt;BR /&gt;
handle into Xrecord of objects would be the next good idea?&lt;BR /&gt;
&lt;BR /&gt;
The idea here, or the project I'm working on, is still in it's beginning phase, &lt;BR /&gt;
so this is just trying to flesh out ideas and solutions for those ideas.  I &lt;BR /&gt;
think it should be possible to do this with handles.  One question I have from &lt;BR /&gt;
this is: is there another way to key the drawing rather then the drawing name? &lt;BR /&gt;
Does the dwg itself have a key or handle, or am I relying on the name.  My first &lt;BR /&gt;
reaction would be, only name.&lt;/CRYSTALBLUEJOSH&gt;</description>
      <pubDate>Mon, 12 Apr 2010 15:21:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664071#M65945</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-12T15:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664072#M65946</link>
      <description>as i see it, the file name has tendency to become useless&lt;BR /&gt;
for example - what if user has multiple open documents and some of them are &lt;BR /&gt;
the same (he opens same file but as read only)&lt;BR /&gt;
and also for storing name - what if user renames files?&lt;BR /&gt;
&lt;BR /&gt;
there must be some hash or something to get by this thing&lt;BR /&gt;
maybe you wanted to say - to write in file NOD some unique number and also &lt;BR /&gt;
same one in xrecord of entitys?&lt;BR /&gt;
&lt;BR /&gt;
for - i think that the problem of copy/pasted object within a file is solved &lt;BR /&gt;
by using handle written in xrecords&lt;BR /&gt;
(if we didn't write its handle in xrecord, than it is not ours)&lt;BR /&gt;
what is left is when user copy/paste objects from file to file, and autocad &lt;BR /&gt;
(low chance but possible) gives some of that object same handle like one he &lt;BR /&gt;
had in file before in wich case - xrecord and handle are correct, but entity &lt;BR /&gt;
is still not ours in this new file&lt;BR /&gt;
&lt;BR /&gt;
so is than number to write in file nod, and entity xrec to be RND(double)?&lt;BR /&gt;
or is there some hash that file internaly has (like objects have handle)?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6371311@discussion.autodesk.com...&lt;BR /&gt;
What many do is use a data table that stores both&lt;BR /&gt;
the DWG filename keyed to a unique identifier that&lt;BR /&gt;
can be nothing more than a integer.&lt;BR /&gt;
&lt;BR /&gt;
That table can be used to lookup the filename so&lt;BR /&gt;
it doesn't have to be stored with each handle.&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Sun, 18 Apr 2010 16:48:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664072#M65946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-18T16:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664073#M65947</link>
      <description>No, by 'filename' I mean the full path to the file, not just&lt;BR /&gt;
the file's name.&lt;BR /&gt;
&lt;BR /&gt;
If the file is moved, then the database would have to be&lt;BR /&gt;
updated.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"ljb" &lt;NOTMY&gt; wrote in message news:6375069@discussion.autodesk.com...&lt;BR /&gt;
as i see it, the file name has tendency to become useless&lt;BR /&gt;
for example - what if user has multiple open documents and some of them are&lt;BR /&gt;
the same (he opens same file but as read only)&lt;BR /&gt;
and also for storing name - what if user renames files?&lt;BR /&gt;
&lt;BR /&gt;
there must be some hash or something to get by this thing&lt;BR /&gt;
maybe you wanted to say - to write in file NOD some unique number and also&lt;BR /&gt;
same one in xrecord of entitys?&lt;BR /&gt;
&lt;BR /&gt;
for - i think that the problem of copy/pasted object within a file is solved&lt;BR /&gt;
by using handle written in xrecords&lt;BR /&gt;
(if we didn't write its handle in xrecord, than it is not ours)&lt;BR /&gt;
what is left is when user copy/paste objects from file to file, and autocad&lt;BR /&gt;
(low chance but possible) gives some of that object same handle like one he&lt;BR /&gt;
had in file before in wich case - xrecord and handle are correct, but entity&lt;BR /&gt;
is still not ours in this new file&lt;BR /&gt;
&lt;BR /&gt;
so is than number to write in file nod, and entity xrec to be RND(double)?&lt;BR /&gt;
or is there some hash that file internaly has (like objects have handle)?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6371311@discussion.autodesk.com...&lt;BR /&gt;
What many do is use a data table that stores both&lt;BR /&gt;
the DWG filename keyed to a unique identifier that&lt;BR /&gt;
can be nothing more than a integer.&lt;BR /&gt;
&lt;BR /&gt;
That table can be used to lookup the filename so&lt;BR /&gt;
it doesn't have to be stored with each handle.&lt;/TONY.TANZILLO&gt;&lt;/NOTMY&gt;</description>
      <pubDate>Sun, 18 Apr 2010 19:03:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664073#M65947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-18T19:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664074#M65948</link>
      <description>Well, I've gotten as far as creating a demo or sample of how I'm going to create these Xrecords, but now I'm very, very confused.  I've never really dealt with typed values or dictionaries in AutoCAD or anything like this.  So this whole process of adding data to objects just seems confusing.&lt;BR /&gt;
&lt;BR /&gt;
What I want to do for my demo is simply add an XRecord to an object when it's being created or has been created.  I can program this up to the XRecord part.  That's when it gets confusing.  Shouldn't it just be as simple as telling the XRecord what keys I want for the XRecord I'm adding, then setting those values and adding that XRecord to the object?  What I'm seeing is a bunch of result buffers and typed values.  And I don't know what any of that really means.</description>
      <pubDate>Mon, 19 Apr 2010 15:21:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664074#M65948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-19T15:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664075#M65949</link>
      <description>Have you done much AutoCAD.NET development before?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;CRYSTALBLUEJOSH&gt; wrote in message news:6375596@discussion.autodesk.com...&lt;BR /&gt;
Well, I've gotten as far as creating a demo or sample of how I'm going to create &lt;BR /&gt;
these Xrecords, but now I'm very, very confused.  I've never really dealt with &lt;BR /&gt;
typed values or dictionaries in AutoCAD or anything like this.  So this whole &lt;BR /&gt;
process of adding data to objects just seems confusing.&lt;BR /&gt;
&lt;BR /&gt;
What I want to do for my demo is simply add an XRecord to an object when it's &lt;BR /&gt;
being created or has been created.  I can program this up to the XRecord part. &lt;BR /&gt;
That's when it gets confusing.  Shouldn't it just be as simple as telling the &lt;BR /&gt;
XRecord what keys I want for the XRecord I'm adding, then setting those values &lt;BR /&gt;
and adding that XRecord to the object?  What I'm seeing is a bunch of result &lt;BR /&gt;
buffers and typed values.  And I don't know what any of that really means.&lt;/CRYSTALBLUEJOSH&gt;</description>
      <pubDate>Mon, 19 Apr 2010 23:36:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664075#M65949</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-19T23:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664076#M65950</link>
      <description>I haven't done that much.  I've created a few progams that could iterate through objects on the model space and also change text elements based on spreadsheets entered in.  This would be the first real thing I've developed.</description>
      <pubDate>Tue, 20 Apr 2010 11:27:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664076#M65950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-20T11:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664077#M65951</link>
      <description>You should probably consider using whatever materials are&lt;BR /&gt;
available to help become more familiar with the managed&lt;BR /&gt;
ObjectARX API.  Searching this newsgroup usually turns&lt;BR /&gt;
up some useful subjects, and the online documentation has&lt;BR /&gt;
some helpful sample code, although I don't know if it covers&lt;BR /&gt;
storing custom/user data in objects.&lt;BR /&gt;
&lt;BR /&gt;
Xrecords are not attached directly to entities, they are&lt;BR /&gt;
stored in an entity's Extension Dictionary.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;CRYSTALBLUEJOSH&gt; wrote in message news:6376229@discussion.autodesk.com...&lt;BR /&gt;
I haven't done that much.  I've created a few progams that could iterate through &lt;BR /&gt;
objects on the model space and also change text elements based on spreadsheets &lt;BR /&gt;
entered in.  This would be the first real thing I've developed.&lt;/CRYSTALBLUEJOSH&gt;</description>
      <pubDate>Tue, 20 Apr 2010 14:17:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664077#M65951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-20T14:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664078#M65952</link>
      <description>Thanks for the help so far.  I have been working with much of the documentation and working with entities.  XRecords and XData, as well as other custom object data, has been something that there is little to nothing on the internet that I can find.  I can find examples, but this doesn't tell me what these things inherently are.  What you've told me makes me a little concerned.&lt;BR /&gt;
&lt;BR /&gt;
So XRecords are not linked to an object, but they're stored in their extension dictionary?  Does this mean I won't be able to use it to uniquely identify these stations in them?</description>
      <pubDate>Tue, 20 Apr 2010 14:25:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664078#M65952</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-20T14:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664079#M65953</link>
      <description>Ironically, I would suggest checking the VBA documentation - it has an object map which shows the basic relationships between objects and collections such as dictionaries and xrecords.</description>
      <pubDate>Tue, 20 Apr 2010 16:15:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664079#M65953</guid>
      <dc:creator>dgorsman</dc:creator>
      <dc:date>2010-04-20T16:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664080#M65954</link>
      <description>{quote}&lt;BR /&gt;
&lt;BR /&gt;
So XRecords are not linked to an object, but they're stored in their extension&lt;BR /&gt;
dictionary?  Does this mean I won't be able to use it to uniquely identify these&lt;BR /&gt;
stations in them?&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
No, XRecords are linked to objects, just not directly.&lt;BR /&gt;
&lt;BR /&gt;
Every object can have an extension dictionary, and&lt;BR /&gt;
that extension dictionary holds all 'linked' objects,&lt;BR /&gt;
including xrecords, and other 'child' dictionaries.&lt;BR /&gt;
&lt;BR /&gt;
You can consult the native ObjectARX documenation&lt;BR /&gt;
for detailed explainations about what xrecords and&lt;BR /&gt;
extension dictionaries are.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;CRYSTALBLUEJOSH&gt; wrote in message news:6376386@discussion.autodesk.com...&lt;BR /&gt;
Thanks for the help so far.  I have been working with much of the documentation&lt;BR /&gt;
and working with entities.  XRecords and XData, as well as other custom object&lt;BR /&gt;
data, has been something that there is little to nothing on the internet that I&lt;BR /&gt;
can find.  I can find examples, but this doesn't tell me what these things&lt;BR /&gt;
inherently are.  What you've told me makes me a little concerned.&lt;BR /&gt;
&lt;BR /&gt;
So XRecords are not linked to an object, but they're stored in their extension&lt;BR /&gt;
dictionary?  Does this mean I won't be able to use it to uniquely identify these&lt;BR /&gt;
stations in them?&lt;/CRYSTALBLUEJOSH&gt;</description>
      <pubDate>Tue, 20 Apr 2010 16:49:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664080#M65954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-20T16:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664081#M65955</link>
      <description>i'm still a beginner in this and only a part time programmer, so i really &lt;BR /&gt;
appreciate your WILL to anwser Tony&lt;BR /&gt;
but i still think you might be wrong and file name in this context is &lt;BR /&gt;
useless!&lt;BR /&gt;
&lt;BR /&gt;
for example - try to look at document manager opened files, and open same &lt;BR /&gt;
file several times. i may be doing something wrong but all i can rely is &lt;BR /&gt;
(document).gethascode, not filename itself&lt;BR /&gt;
&lt;BR /&gt;
and, all being said - the only thing that is left - is to hope that autocad &lt;BR /&gt;
will not (by chance) give same handle to copied object (being pasted without &lt;BR /&gt;
ours app running in that session, since if it is in our session then one can &lt;BR /&gt;
track it by objectid)&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6375103@discussion.autodesk.com...&lt;BR /&gt;
No, by 'filename' I mean the full path to the file, not just&lt;BR /&gt;
the file's name.&lt;BR /&gt;
&lt;BR /&gt;
If the file is moved, then the database would have to be&lt;BR /&gt;
updated.&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Sun, 25 Apr 2010 10:07:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664081#M65955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-25T10:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664082#M65956</link>
      <description>You might not understand what the OP wants to do.&lt;BR /&gt;
&lt;BR /&gt;
The OP needs to uniquely identify objects across&lt;BR /&gt;
multiple files within a single namespace, outside of&lt;BR /&gt;
the AutoCAD environement (e.g., a database, an&lt;BR /&gt;
excel worksheet, etc.).&lt;BR /&gt;
&lt;BR /&gt;
That means that both the file and the handle of the&lt;BR /&gt;
object must be used to uniquely reference the object.&lt;BR /&gt;
&lt;BR /&gt;
What really puzzles me, is that if you have an external&lt;BR /&gt;
database that contains references to objects in more&lt;BR /&gt;
than one DWG file, how else could you possibly open&lt;BR /&gt;
the file containing one of those objects and access it,&lt;BR /&gt;
without the filename?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2011&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
"ljb" &lt;NOTMY&gt; wrote in message news:6379997@discussion.autodesk.com...&lt;BR /&gt;
i'm still a beginner in this and only a part time programmer, so i really&lt;BR /&gt;
appreciate your WILL to anwser Tony&lt;BR /&gt;
but i still think you might be wrong and file name in this context is&lt;BR /&gt;
useless!&lt;BR /&gt;
&lt;BR /&gt;
for example - try to look at document manager opened files, and open same&lt;BR /&gt;
file several times. i may be doing something wrong but all i can rely is&lt;BR /&gt;
(document).gethascode, not filename itself&lt;BR /&gt;
&lt;BR /&gt;
and, all being said - the only thing that is left - is to hope that autocad&lt;BR /&gt;
will not (by chance) give same handle to copied object (being pasted without&lt;BR /&gt;
ours app running in that session, since if it is in our session then one can&lt;BR /&gt;
track it by objectid)&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6375103@discussion.autodesk.com...&lt;BR /&gt;
No, by 'filename' I mean the full path to the file, not just&lt;BR /&gt;
the file's name.&lt;BR /&gt;
&lt;BR /&gt;
If the file is moved, then the database would have to be&lt;BR /&gt;
updated.&lt;/TONY.TANZILLO&gt;&lt;/NOTMY&gt;</description>
      <pubDate>Sun, 25 Apr 2010 11:41:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664082#M65956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-25T11:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Best object for automatic creation: Xrecord or Xdata</title>
      <link>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664083#M65957</link>
      <description>opening is not a problem, you need file name for opening, true, but checking &lt;BR /&gt;
is that object in it is "the one" and in situation that we have left it in &lt;BR /&gt;
(remember, if not pass protected and monitored by our app, anyone can open &lt;BR /&gt;
dwg and mess with it)&lt;BR /&gt;
...and so, open same file twice, use dictionary(of filename-string, data &lt;BR /&gt;
connected to objects)&lt;BR /&gt;
and try by using handlers - to see when your file is active. but, do not use &lt;BR /&gt;
doc type, use doc.file name to find&lt;BR /&gt;
you will see (al least it happened then to me) that file name returned is &lt;BR /&gt;
the same for both files&lt;BR /&gt;
only hashcode was different and that was how i knew to distinct files&lt;BR /&gt;
hence, i concluded that file name is no good. and second, most important &lt;BR /&gt;
thing - if you have noticed, some people like to have specific name for some &lt;BR /&gt;
file, and they keep renaming files a lot and in that way, saving file name &lt;BR /&gt;
in database is no good for tracking specific objects.&lt;BR /&gt;
&lt;BR /&gt;
well, as i said, my solution is here:&lt;BR /&gt;
1) to write handle in xrecord&lt;BR /&gt;
2) to RND number and place it in NOD and then use that number and write it &lt;BR /&gt;
in xrecord for every single my object&lt;BR /&gt;
&lt;BR /&gt;
in that way - object when pasted to different file will have wrong that &lt;BR /&gt;
(RND) number&lt;BR /&gt;
and when pasted within same file - will have wrong handle&lt;BR /&gt;
&lt;BR /&gt;
i have never write in NOD anything yet thoug, but, i think it's &lt;BR /&gt;
strait-forward&lt;BR /&gt;
so, for me it is solved, and i very much thank you for your time Tony!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6380015@discussion.autodesk.com...&lt;BR /&gt;
...&lt;BR /&gt;
What really puzzles me, is that if you have an external&lt;BR /&gt;
database that contains references to objects in more&lt;BR /&gt;
than one DWG file, how else could you possibly open&lt;BR /&gt;
the file containing one of those objects and access it,&lt;BR /&gt;
without the filename?&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Sun, 25 Apr 2010 19:34:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/best-object-for-automatic-creation-xrecord-or-xdata/m-p/2664083#M65957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-25T19:34:24Z</dc:date>
    </item>
  </channel>
</rss>

