The only thing LDATA offers is that it preserves
the original list structure, which is something
that is
useful only to entry level programmers.
Ouch!!! My ego is permananetly scarred.....I jest. I'm certainly not an expert.
Point taken.
Now, I don't pretend to know anything about using Xrecords, as I've only scraped the surface. But, If I wanted to make the switch, I would take, for example, 50 custom drawing settings stored as Ldata inside a custom dictionary, and create 50 separate Xrecords. Am I right? For example, storing the text height for multiple different Text Styles would require an Xrecord for each.
The only way I know how to create Xrecords is like this:
Code:
(if (setq xlist (dictsearch (namedobjdict) "TextStyleNameHere"))
(entdel (cdr (assoc -1 xlist)))
)
(setq xrec (list '(0 . "XRECORD")
'(100 . "AcDbXrecord")
'(1 . "TextStyleNameHere")
'(40 . 2.5)
'(blah . blah..if there's more stuff to put.)
)
)
(setq xname (entmakex xrec))
(dictadd (namedobjdict) "TextStyleNameHere" xname)
The above works for me when adding a new record or changing an existing one (deleteing and re-creating). This is virtually straight from the Visual Lisp Help files.
If that's the case, I can acheive the same with one line of code using LDATA
Code:
(vlax-ldata-put "MyDictionary" "TextStyleNameHere" 2.5)
I know that I could store multiples inside one Xrecord, but am not sure how I would extract the info to change it. I must be missing something (more like probably).
I've gone through 5 versions of CAD using LDATA (2000i, 2002, 2004, 2005, and have tested 2006). Drawings that contained LDATA in 2000i have kept it intact the entire way through. However, if there was data loss in migration from 14 to 2000, than I guess the risk is there for it to happen again. Although, for my purposes, if a drawing lost it's LDATA it would not be a catastrophic loss, and easy to re-create.
For someone that has no intention of using another API, and who does not care if stored data gets lost, it just seems like LDATA is the more logical choice, entry-level or expert alike. But, again, I speak without knowing all the facts and methods for coding the use of Xrecords.
But, I digress. Back to the original question: Regardless of whether or not some would advise against it's use, I was just curious as to whether or not Robert's comment to me a while back was rooted in some knowledge that LDATA may become obsolete at some point in time.