See the following code for changing the Viewport Type.
(defun GetVpType (vpObj / APPNAME xTypeOut xDataOut)
(setq APPNAME "AeccPlanProd50ViewportType")
(vlax-invoke-method vpObj 'GetXData APPNAME 'xTypeOut 'xDataOut)
(if (not xDataOut) 0 (vlax-variant-value (cadr (vlax-safearray->list xDataout))))
)
(defun SetVpType (vpObj vpType / APPNAME xTypeIn xDataIn)
(setq APPNAME "AeccPlanProd50ViewportType")
(regapp APPNAME)
(setq xTypeIn (vlax-make-safearray vlax-vbInteger '(0 . 1)))
(setq xDataIn (vlax-make-safearray vlax-vbVariant '(0 . 1)))
(vlax-safearray-put-element xTypeIn 0 1001)
(vlax-safearray-put-element xDataIn 0 APPNAME)
(vlax-safearray-put-element xTypeIn 1 1070)
(vlax-safearray-put-element xDataIn 1 vpType)
(vlax-invoke-method vpObj 'SetXData xTypeIn xDataIn)
)
(defun c:Test ( / ss vpObj vpType)
(setq ss (ssget ":s" '(( 0 . "VIEWPORT"))))
(if ss
(progn
(setq vpObj (vlax-ename->vla-object (ssname ss 0)))
(setq vpType (GetVpType vpObj))
(cond
((= vpType 0) (setq vpType 1))
((= vpType 1) (setq vpType 2))
((= vpType 2) (setq vpType 3))
((= vpType 3) (setq vpType 0))
)
(SetVpType vpObj vpType)
)
)
(princ)
)