Listing Symbols
The following will give
you a list of all entries in a symbol table. This is
great for creating a list to populate a list box in DCL.
;;;Start Coding Here
(defun tablelist (s / d r)
(while
(setq d (tblnext s (null d)))
(setq r (cons (cdr (assoc 2 d)) r))
);while
);defun
;;;End Coding Here
|
For example, if you would
like a list of all layers in a specific drawing,
use this :
(setq all_layers (tablelist "LAYER"))
AutoLisp should return something like this :
("7" "6" "5" "4"
"3" "2" "0")
To populate a list box with the key of "selections," use this
:
(start_list "selections")
(mapcar 'add_list all_layers)