Is it possible to do a tablesearch on layerstates? This is what I have written. Why does this not work? How do I change it? (defun c:savels-ao () (setvar "cmdecho" 0) (command "undo" "end") (command "undo" "group") (setq lay(getvar "clayer")) (setvar "clayer" "0") (if (tblsearch "ACAD_LAYERSTATES" "ALL_ON")) (command "-layer" "state" "delete" "ALL_ON" "" "")) (command "-layer" "state" "save" "ALL_ON" "" "" "") (setvar "clayer" lay) (command "undo" "end") (setvar "cmdecho" 1) (princ " *** Layer State ALL_ON Saved *** ") (princ) )