Satish Lele
satish.lele@gmail.com


Accessing AutoCAD’s System Tables
tblsearch: Searches a symbol table for a symbol name.
(tblsearch table-name symbol [setnext])
The tblsearch function searches the symbol table, table-name, for the symbol name symbol. Both names are converted to upper case automatically. If tblsearch finds an entry for the given symbol name, it returns that entry in the format described for tblnext. If no such entry is found, it returns nil.
(tblsearch "style" "standard") Retrieves text style. It might return
((0 . "STYLE") Symbol name
(70 . 0) ;Flags
(40 . 0.0) Fixed height
(41 . 1.0) Width factor
(50 . 0.0) Obliquing angle
(71 . 0) Generation flags
(3 . "txt") Primary font file
(4 . "") Bigfont file
)
Normally, tblsearch has no effect on the order of entries retrieved by tblnext. However, if tblsearch is successful and the setnext argument is present and non-nil, the tblnext entry counter is adjusted so that the following tblnext call returns the entry after the one returned by this tblsearch call.

tblnext: Finds the next item in a symbol table. (tblnext table-name [rewind])
The table-name argument is a string the identifies the symbol table. Valid table-name values are "LAYER", "LTYPE", "VIEW", "STYLE", "BLOCK", "UCS", "APPID", "DIMSTYLE", and "VPORT". The string does not need to be upper case. Since the vports function returns current VPORT table information, it may be easier to use vports as opposed to tblnext to retrieve this information.
When tblnext is used repeatedly, it normally returns the next entry in the specified table each time. tblsearch function can set the next entry to be retrieved. However, if the rewind argument is present and evaluates to a non-nil value, the symbol table is rewound and the first entry in it is retrieved. If there are no more entries in the table, nil is returned. Deleted table entries are never returned. If an entry is found, it is returned as a list of dotted pairs of DXF-type codes and values.
(tblnext "layer" T) Retrieves first layer. It might return
((0 . "LAYER") Symbol type
(2 . "0") Symbol name
(70 . 0) Flags
(62 . 7) Color number, negative if off
(6 . "CONTINUOUS") Linetype name
)
backBack top