TheSwamp
Code Red => .NET => Topic started by: mohnston 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?
-
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.
-
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
-
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.
-
Attsync maybe deletes the original and places a new block. Was it not an express tool from origin?
-
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.
-
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:
-
I have not experienced xdata loss after AttSync either. (R08, R11 and R13)
-
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.