I am working on a script that iterates through a grid feature class, zooms/pans to the next square of the grid and outputs a PDF, compiling them all into one PDF to be printed into an atlas booklet. This is an internal script that has been rewritten many times to accommodate different uses for different departments and agencies. For this one, we want to show text on the pages that don't show the relevant feature class: "This page does not contain any [feature class] features". I found a way to do this by grabbing the extent of the map frame camera, creating a polygon of it, selecting the features that intersect and then adding the text to the pages that do not have a selection.
I'm thinking there's at least two ways this process could be shortened:
- allow an extent property to be used as an input feature for a selection
- add a Boolean property to the Layer class that indicates the presence/absence of specified features visible in a mapframe's current camera extent
Currently, the {Layer}.visible() Boolean seems to only check if the layer is toggled visible in the table of contents, so I'm not sure what it might be called. {Layer}.isVisible() might be too confusing.