A little assistance needed here. I am trying to get this to check for any items on Layer 0 and omit the Viewport and report back to the use if any found besides the Viewport back to the user via Alert. Can someone shed some light on this or is there a better way?
(defun chk_layer_0 (/ ss)
(princ "\nChecking for objects on layer 0")
(if (setq ss (ssget "x" '((8 . "0"))))
(if (= 1 (sslength ss))
(if (and (= "VIEWPORT" (cdr (assoc 0 (entget (ssname ss 0)))))
(= 1 (cdr (assoc 69 (entget (ssname ss 0)))))
)
(progn
(princ "\nNo objects found on layer 0.")
) ;end progn
(progn
(princ (strcat "\nLocated "
(itoa (sslength ss))
" objects on layer 0."
)
)
)
)
)
)
(progn
(princ "\nNo objects found on layer 0.")
)
)
Thanks,
Don