If you're referring to the DXF 60 group (the way MDT makes stuff invisible, for instance), here's a program to make stuff invisible and a second to make it visible again. It shows how the DXF 60 group turns visibility on or off. Are you sure that, in your drawing(s), you don't just have layers frozen in certain viewports? These programs don't help with that, but then it's easy to un-freeze the layers too.
Code:
;;; HIDENTS Program
;;; Makes objects invisible (not just by layer)
;;; Restore visibility with SHOWENTS
(defun c:hidents (/ ss sl ent elist)
(prompt "\nSelect objects to make INVISIBLE:")
(setq ss (ssget))
(if (not (null ss))
(progn
(setq sl (itoa(sslength ss)))
(if (not (= (sslength ss) 0))
(progn
(setq ent (ssname ss 0))
(while (> (sslength ss) 0)
(ssdel ent ss)
(setq elist (entget ent))
(if (not (null (assoc 60 elist)))
(setq elist (subst (cons 60 1) (assoc 60 elist) elist))
(setq elist (append (list (cons 60 1)) elist))
)
(entmod elist)
(setq ent (ssname ss 0))
)
(princ (strcat "\n" sl " object(s) made INVISIBLE. Restore with SHOWENTS."))
)
)
)
)
(princ)
)
(defun c:showents (/ ss sl ent elist)
(setq ss (ssget "X" '((60 . 1))))
(if (not (null ss))
(if (not (= (sslength ss) 0))
(progn
(setq ent (ssname ss 0))
(setq sl (itoa(sslength ss)))
(while (not (= (sslength ss) 0))
(ssdel ent ss)
(setq elist (entget ent))
(setq elist (subst (cons 60 0) (assoc 60 elist) elist))
(entmod elist)
(setq ent (ssname ss 0))
)
(princ (strcat "\nVisibility restored to " sl " object(s)."))
)
(princ "\nNo invisible objects found.")
)
(princ "\nNo invisible objects found.")
)
(princ)
)