I just created this lisp to report any layouts with a vp that is not on a specific layer.
Using the "skip the first viport in the database for each tab" to ignore the layout's vp object.
Is this reliable? Is there another way to detect it, Not using ssget?
;; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
;; Find vp not on layer "Viewport Borders"
;; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
(defun c:vpFind (/ vpLayer lay obj result id1)
(setq vpLayer "Viewport Borders")
(vlax-for lay (vla-get-layouts(vla-get-activedocument (vlax-get-acad-object)))
(setq id1 nil) ; ignore the first vp
(if (eq :vlax-false (vla-get-modeltype lay))
(progn
(princ (strcat "\n*** TAB - " (vla-get-name lay) " ***"))
(vlax-for obj (vla-get-block lay) ; for each obj in layout
(if (and (= (vla-get-objectname obj) "AcDbViewport")
(or id1 (not (setq id1 t))))
(if (/= (vla-get-layer obj) vpLayer)
(progn ; collect vports
(princ (strcat "\n" (vla-get-name lay) " -> " (vla-get-layer obj)))
(setq result (cons (List lay obj) result))
))
)
))
)
)
(princ)
)