Author Topic: XData vs other data storage methods  (Read 4832 times)

0 Members and 1 Guest are viewing this topic.

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
XData vs other data storage methods
« on: March 06, 2013, 02:04:25 PM »
I have many applications that store xdata in AutoCAD objects. The xdata is stored as text but is actually in Field:Value format.
I started using this method of storing data before I was aware of dictionaries, hash tables, collections and other containers that could be used.

What method, in your opinion, should I use to store Field/Value pairs in AutoCAD objects?
Why?
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

TheMaster

  • Guest
Re: XData vs other data storage methods
« Reply #1 on: March 06, 2013, 08:27:07 PM »
I have many applications that store xdata in AutoCAD objects. The xdata is stored as text but is actually in Field:Value format.
I started using this method of storing data before I was aware of dictionaries, hash tables, collections and other containers that could be used.

What method, in your opinion, should I use to store Field/Value pairs in AutoCAD objects?
Why?

I've used a few different formats, depending on the need, but one that seems to work well for cases where you are dealing with key/value pairs, is the same one used by AutoCAD to store DIMSTYLE overrides, where the DIMVAR name is the key, and is followed by the value in the resbuf chain.

The only advantage is that it doesn't require parsing or conversion from/to string data.

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: XData vs other data storage methods
« Reply #2 on: March 07, 2013, 06:02:21 AM »
Be careful using Xdata on blocks - ATTSYNC destroys the XDATA. Here's a pretty (by Autodesk standards...and probably temporary too) URL in the documentation to confirm: http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS1a9193826455f5ffa23ce210c4a30acaf-512c.htm,topicNumber=d0e199454

TheMaster

  • Guest
Re: XData vs other data storage methods
« Reply #3 on: March 09, 2013, 03:25:08 AM »
Be careful using Xdata on blocks - ATTSYNC destroys the XDATA. Here's a pretty (by Autodesk standards...and probably temporary too) URL in the documentation to confirm: http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS1a9193826455f5ffa23ce210c4a30acaf-512c.htm,topicNumber=d0e199454

Looks like sabotage to me.

I can't think of any other explaination for why it happened in the first place, and why it has persisted so long.

huiz

  • Swamp Rat
  • Posts: 913
  • Certified Prof C3D
Re: XData vs other data storage methods
« Reply #4 on: March 09, 2013, 06:19:38 AM »
Attsync maybe deletes the original and places a new block. Was it not an express tool from origin?
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

TheMaster

  • Guest
Re: XData vs other data storage methods
« Reply #5 on: March 09, 2013, 05:15:33 PM »
Attsync maybe deletes the original and places a new block. Was it not an express tool from origin?

Yes, it was an express tool, but it's part of the base product now, meaning that the various hacks that have been  used in many express tools are not really appropriate for core commands, and the limitation is unnecessary and unreasonable.


TheMaster

  • Guest
Re: XData vs other data storage methods
« Reply #6 on: March 11, 2013, 02:51:52 AM »
Be careful using Xdata on blocks - ATTSYNC destroys the XDATA. Here's a pretty (by Autodesk standards...and probably temporary too) URL in the documentation to confirm: http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS1a9193826455f5ffa23ce210c4a30acaf-512c.htm,topicNumber=d0e199454

I checked this in R12 and R13 and ATTSYNC doesn't trash XData (I didn't check extension dictionaries however). Perhaps the docs are "stale" :roll:


mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
Re: XData vs other data storage methods
« Reply #7 on: March 11, 2013, 12:13:47 PM »
I have not experienced xdata loss after AttSync either. (R08, R11 and R13)
« Last Edit: March 11, 2013, 04:25:10 PM by mohnston »
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

TheMaster

  • Guest
Re: XData vs other data storage methods
« Reply #8 on: March 15, 2013, 06:43:56 AM »
Be careful using Xdata on blocks - ATTSYNC destroys the XDATA. Here's a pretty (by Autodesk standards...and probably temporary too) URL in the documentation to confirm: http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS1a9193826455f5ffa23ce210c4a30acaf-512c.htm,topicNumber=d0e199454

This looks like a documentation bug. It may trash XDATA attacked to attributes, and that is most-likely what the warning is about.