This lsp allows you to turn on and tahw all layers, do work and restore the layer state.
(I know I can make a layer state each time, but this is so much easier)
I am open to suggestions and please let me know if Acad already has something like this somewhere.
The lsp does the following
-Creates a layer state with a specific name
-Turns on and thaws all layers
-Sets up so next time you enter the command it will restore your layer state.
I created this lisp several years ago and I loved it, just changed positions and needed to recreate the routine.
Code:
(princ "\nThaw_or_Restore.lsp type \"LOT\" to begin command\n")
(defun c:lot (/ lsname othaw_or_restore)
(if (not thaw_or_restore) (setq thaw_or_restore "thaw"))
(setq othaw_or_restore thaw_or_restore)
(if
(= othaw_or_restore "thaw")
(thawall))
(if
(= othaw_or_restore "restore")
(thawrestore))
(princ))
(defun thawall (/ lsname)
(command "undo" "begin")
(setq lsname "thaw_and_restore")
(if (=
(command ".layer" "state" "save" lsname "" "" "")
nil)
(progn
(command ".layer" "state" "delete" lsname "" "" "")
(command ".layer" "state" "save" lsname "" "" "")
)
)
(command ".layer" "state" "save" lsname "" "" "")
(command "-layer" "thaw" "*" "" "")
(command "-layer" "on" "*" "" "")
(setq thaw_or_restore "restore")
(graphscr)
(command "undo" "end")
(princ "\nall layers on and thawed")
(princ))
(defun thawrestore (/ lsname)
(command "undo" "begin")
(setq lsname "thaw_and_restore")
(command ".layer" "state" "restore" lsname "" "" "")
(command ".layer" "state" "delete" lsname "" "" "")
(setq thaw_or_restore "thaw")
(graphscr)
(command "undo" "end")
(princ "\nlayer state restored")
(princ))