Author Topic: xdata vs xrecords?  (Read 7975 times)

0 Members and 1 Guest are viewing this topic.

cadman6735

  • Guest
xdata vs xrecords?
« on: July 21, 2011, 02:15:34 PM »


Going thru the help menu I have an idea that xdata is data appended to an entity and that an xrecord is data that is stored in the file itself (non-graphical data) and a dictionary is a container that I can store xrecords in.

am I close?

Thanks

Jeff H

  • Needs a day job
  • Posts: 6150
Re: xdata vs xrecords?
« Reply #1 on: July 21, 2011, 02:39:45 PM »
Do you Lisp guys ever look at the arxdev.chm if not has alot good info about objects you deal with?

Has info about Xdata and Xrecords

I will attach it

****EDIT******
If it does not show pages then probably have right click on file go to properties and click the unblock button

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: xdata vs xrecords?
« Reply #2 on: July 21, 2011, 03:31:33 PM »
Hi,

I try a brief explaination.

There're two dictionary types:
- the dictionaries wich are entries of the Named Object Dictionary (NOD) these ones own the the drawing.
- the extension dictionaries which own to objects (graphical as drawing entities or non-graphical as layers, styles or dictionaries). These ones can be used quite the same way as Xdatas. An object can only have one extension dictionary.

Any dictionary can contain others dictionaries and/or Xrecords , Xrecords contain datas.

LISP datas (ldata) are also dictionaries (of both types), they're easier to use with the vlax-ldata-* functions but are only accessibles from LISP (xdatas and dictionaries/xrecords can be accessed with VBA and .NET too).
Speaking English as a French Frog

Jeff H

  • Needs a day job
  • Posts: 6150
Re: xdata vs xrecords?
« Reply #3 on: July 21, 2011, 03:48:10 PM »
In the file attached in previous post use the term 'ExtendedData' for Xdata
when doing a index search.


psuchewinner

  • Guest
Re: xdata vs xrecords?
« Reply #4 on: July 21, 2011, 05:25:27 PM »
Back in 2003, I ran across an article that Kenny Ramage posted on Afralisp that Stig Madsen wrote about Xrecords and Xdata.  Maybe someone can dig that up.  It was very informative.

psuchewinner

  • Guest
Re: xdata vs xrecords?
« Reply #5 on: July 21, 2011, 05:28:11 PM »

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: xdata vs xrecords?
« Reply #6 on: July 21, 2011, 05:41:31 PM »
XData and Extension dictionaries can be attached to (almost) any object in a drawing.  This includes non-graphical objects, like the NamedObjectDictionary (NOD) and its dictionaries such as Layers or Groups. 

I've attached XData to both objects and Dictionaries, but found XData is generally more suited for attaching to objects.  XData is indexed by registered applications (RegApps), so you can assign data for one "application" without interfering with others.  There is a limit to the total XData you can assign to any given object but its quite big; if you overrun the limit its a good indication there's a better way to do what you are trying.

Extension Dictionaries can contain both XRecords and other Extension Dictionaries.  More extensive nested tree structures of data work better with Extension Dictionaries/XRecords than with XData IMHO.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: xdata vs xrecords?
« Reply #7 on: July 22, 2011, 02:42:48 AM »
The "major" difference between the 2 is:
  • Maximum size: XRecords have no limit; XData has a maximum limit per entity (both graphical and non-graphical).
  • XRecords can contain any form of data you can place in it; XData must be placed in a specific DXF code per type of data.
  • XRecords are simply data, nothing else; XData can have some "smart" values, e.g. placing a real value into the 1040 DXF group makes it simply a value, but if it's in 1041 the value changes automatically when the object it's attached to is scaled. (DXF codes for XData)
Other than that, it's simply the difference in the way you create / modify / access these values.

So if your data is going to be more than 16KB, you have no choice but XRecord/Dictionary. If your data needs to adjust according to alterations on the object you need to use XData. If you cannot find a dxfcode which can hold the form of data you want to store (a bit difficult as there's 1004 for binary data), then you're stuck with XRecord again.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

laidbacklarry

  • Guest
Re: xdata vs xrecords?
« Reply #8 on: July 22, 2011, 07:58:53 AM »
An important limitation of Xdata is the limitation of 255 characters for strings, DXF code 1002. Attaching a long specification that is read in from an external text file, for example, will require a routine to break the text into multiple strings of 255 characters or less. We don't use xrecords so I'm not sure if a similar limitation exists.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: xdata vs xrecords?
« Reply #9 on: July 22, 2011, 10:01:56 AM »
An important limitation of Xdata is the limitation of 255 characters for strings, DXF code 1002. Attaching a long specification that is read in from an external text file, for example, will require a routine to break the text into multiple strings of 255 characters or less. We don't use xrecords so I'm not sure if a similar limitation exists.
I don't think it's a "difference" between the 2. XRecords are still just saved as normal DXF data lists inside the drawing. And that 255 text limit is actually a DXF limit. Having tested for myself, this does seem to be the case.

I just placed a extremely long string into a dictionary using the vlax-ldata-put. Then saved the drawing as DXF and opened it in Notepad++. At the end there's a XRecord object with several 310 codes. These seem to be hexadecimal versions of the characters in the string. Each 310 is a maximum of 255 characters long. So it appears that XRecords also has this same limit.

The idea behind XRecords has "no limit on size" thus is more like: It has no limit on total size, though there's still the 255 limit per code.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

cadman6735

  • Guest
Re: xdata vs xrecords?
« Reply #10 on: July 25, 2011, 05:42:07 PM »
Thank you all, this has been very help for me...   :lol: