Here is one I use for on/off layers. It allows you to select layers that are off to turn them on.
It can propably be modified for the other possibilities
;;; ------------------------------------------------------------------------
;;; LLO.LSP Version 1.0
;;;
;;; Copyright© MAY, 2001
;;; Timothy G. Spangler
;;;
;;; Permission to use, copy, modify, and distribute this software
;;; for any purpose and without fee is hereby granted, provided
;;; that the above copyright notice appears in all copies and
;;; that both that copyright notice and the limited warranty and
;;; restricted rights notice below appear in all supporting
;;; documentation.
;;;
;;; Allows the user to turn on selected layers
;;;
;;; ------------------------------------------------------------------------
(defun C:LLO (/ Off Layer EntList LayerName LayerList Color)
;; Create lists o on/off layers
(while (setq Layer (tblnext "LAYER" (null Layer)))
(if (minusp (cdr (assoc 62 Layer)))
(setq Off T)
)
)
;; Select layers to turn on
(if Off
(progn
;; Invert layers
(while (setq Layer (tblnext "LAYER" (null Layer)))
(LAYER_SWITCH (cdr (assoc 2 Layer)))
)
;; Select layers to turn on
(while (setq EntName (car (entsel "\n Select layers(s) to turn on:")))
(setq EntList (entget EntName))
(setq LayerName (cdr(assoc 8 EntList)))
(setq LayerList (entget (tblobjname "LAYER" LayerName)))
(setq Color (assoc 62 LayerList))
(entmod (subst (cons 62 (- (cdr Color))) Color LayerList))
)
;; Reinvert layers
(while (setq Layer (tblnext "LAYER" (null Layer)))
(LAYER_SWITCH (cdr (assoc 2 Layer)))
)
)
(princ "\n All layers are turned on")
)
(princ)
)
;; Sub routine to turn layers on/off
(defun LAYER_SWITCH (Layer / Tmp Clr)
(setq Tmp (entget (tblobjname "LAYER" Layer)))
(setq Clr (assoc 62 Tmp))
(entmod (subst (cons 62 (- (cdr Clr))) Clr Tmp))
(princ)
)
;;;
;;; Echos to the command line
(princ "\nTurns on selected layers v1.0 \n ©Timothy Spangler, \n May, 2001....loaded.")
(terpri)
(princ "C:LLO")
(print)
;;; End echo