I am working on a script that will run through a variety of selections within each state. The extents are fine for all states except Hawaii and Alaska where the islands trail off and cause the feature extent to be much bigger than I want it to be. What I'm trying to do is when the script is running, once it hits Alaska, it does the selections, then zooms to a custom extent.
I've tried to use code I've found in other posts without success. Anyone have insight into how to do this?
def zoomToFullExtent(map_document):
DF = map_document.activeDataFrame
DF_extent = DF.extent
for lyr in arcpy.mapping.ListLayers(map_document, data_frame=DF):
extent = lyr.getExtent()
DF_extent.XMin = -20022466.14
DF_extent.XMax = -14434454.96
DF_extent.YMin = 6025271.58
DF_extent.YMax = 11927735.38
DF.extent = DF_extent