I think that Ldata, which is also stored in dictionaries, should be mentioned here.
I have heard that there have been issues in the past with Ldata: applications would crash, drawings would become corrupt and Autodesk, apparently, was less than completely honest about it all. If I remember the stories correctly, these problems occurred around the time of Release 14 or AutoCAD 2000. I have not heard of problems with Ldata in recent versions of AutoCAD.
The convenience of Ldata is that you do not need any special code to store Lisp data (=Ldata).
There are 5 built-in functions to deal with Ldata:
vlax-ldata-delete
vlax-ldata-get
vlax-ldata-list
vlax-ldata-put
vlax-ldata-test
Example:
(vlax-ldata-put "myDict" "myKey" '((STRING . "Abc") (POINT 1.0 2.0 3.0)))
(vlax-ldata-get "myDict" "myKey") => ((STRING . "Abc") (POINT 1.0 2.0 3.0))
To prove that Ldata is stored in a dictionary:
(dictsearch (cdr (assoc -1 (dictsearch (namedobjdict) "myDict"))) "myKey")
=>
(
(-1 . <Entity name: cb2da80>)
(0 . "VLO-VL")
(5 . "3DF")
(102 . "{ACAD_REACTORS")
(330 . <Entity name: 18bab280>)
(102 . "}")
(330 . <Entity name: 18bab280>)
(100 . "vlo_VL")
(90 . -64512)
(91 . 65)
(92 . 3)
(40 . 1.0)
(40 . 2.0)
(40 . 3.0)
(300 . "((STRING . \"Abc\") (POINT (&VLO-R . 0) (&VLO-R . 1) (&VLO-R . 2)))")
)
Ldata can also be attached to a drawing entity. It is then stored in the extension dictionary of the entity.