(defun c:vpl (/ vplst ss)
(if (setq vplst nil
ss
(ssget "_X"
'((-4 . "<OR")
(-4 . "")
(0 . "VIEWPORT")
(-4 . "OR>")
)
)
)
(progn
(repeat (setq i (sslength ss))
(if (and (not (member (setq vpl
(cdr (assoc 8 (entget (ssname ss (setq i (1- i))))))
) vplst )
)
(/= vpl "0")
)
(setq vplst (cons vpl vplst))
)
)
(textscr)
(princ"\nViewports are on the following layers")
(foreach itm vplst (print itm))
)
)
(princ)
)
(c:vpl)

Advertisements