Thank you very much BeekeeCZ, this is exactly what I need.
I am incorporating your routine in another one I have so it will change the VisualStyle of all viewports in each layout of the drawing:
(defun C:VPVS ()
(set numerolayouts (length (layoutlist)))
(setq test 0)
(while (< test numerolayouts)
(setvar 'ctab (if (= (getvar 'catb) (last (layoutlist))) (car (layoutlist)) (cadr (member (getvar 'ctab) (layoutlist)))))
(command "PSPACE")
;; ------Start BeeKee Routine-----
(if (and (or (= 1 (getvar 'cvport)) (prompt "\nError: Needs to be run from paperspace.")) (setq ss (ssget "_A" (list '(0 . "VIEWPORT") (cons 410 (getvar 'ctab))))) ) (repeat (setq i (sslength ss)) (setpropertyvalue (ssname ss (setq i (1-i))) "VisualStyle" 1)))
;; ---------End---------
(setq test (1+ test))
)
(princ)
)
by the way, is there a way to incorporate Shortcut Keys in a Autolisp routine?
Thanks again BeeKeeCZ