Retrieves LISP data from a drawing dictionary or an object
(vlax-ldata-get dict key [default-data] [private])
Arguments
A VLA-object, an AutoCAD drawing entity object, or a string naming a global dictionary.
A string specifying the dictionary key.
LISP data to be returned if no matching key exists in the dictionary.
nil value is specified for private and vlax-ldata-get is called from a separate-namespace VLX, vlax-ldata-get retrieves private LISP data from dict.
If a non-nil for default-data.
If you specify private, you must also specify default-data; you can useNote that a separate-namespace VLX can store both private and non-private data using the same dict and key. The private data can be accessed only by the same VLX, but any application can retrieve the non-private data.
Return Values
The value of the key item.
Examples
Enter the following commands at the Visual LISP Console window:
_$ (vlax-ldata-put "mydict" "mykey" "Mumbo Dumbo")
"Mumbo Dumbo"
_$ (vlax-ldata-get "mydict" "mykey")
"Mumbo Dumbo"
To test the use of private data from a VLX
_$ (vlax-ldata-put "mydict" "mykey" "Mumbo Dumbo")
"Mumbo Dumbo"
_$ (vlax-ldata-get "mydict" "mykey")
"Mumbo Dumbo"
(vl-doc-export 'ldataput)
(vl-doc-export 'ldataget)
(vl-doc-export 'ldataget-nilt)
(defun ldataput ()
(princ "This is a test of putting private ldata ")
(vlax-ldata-put "mydict" "mykey" "Mine! Mine! " T)
)
(defun ldataget ()
(vlax-ldata-get "mydict" "mykey")
)
(defun ldataget-nilt ()
(vlax-ldata-get "mydict" "mykey" nil T)
)
_$ (ldataput)
This is a test of putting private ldata
ldataput: this function stores a string containing “Mine! Mine!â€
Refer to the code defining_$ (ldataget)
"Mumbo Dumbo"
ldataget is not the data stored by ldataput. This is because ldataget does not specify the private argument in its call to vlax-ldata-get. So the data retrieved by ldataget is the data set by issuing vlax-ldata-put from the Visual LISP Console in step 1.
Notice that the data returned by_$ (ldataget-nilt)
"Mine! Mine! "
_$ (ldataget-nilt)
"Mine! Mine! "
ldataput is returned, because ldataget-nilt specifies the private argument in its call to vlax-ldata-get.
This time the private data saved by_$ (vlax-ldata-get "mydict" "mykey" nil T)
"Mumbo Dumbo"
vlax-ldata-get is issued outside a separate-namespace VLX. If non-private data exists for the specified dict and key (as in this instance), that data will be retrieved.
The private argument is ignored when