I actually found someone elses code that worked. How to I change this to make the file name the name of each polygon. It's stored in the attribute table. import arcpy from arcpy import env from arcpy import mapping env.workspace = "CURRENT" mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] for lyr in arcpy.mapping.ListLayers(mxd): lyr.visible = True fc = r"C:\GIS\Grid.shp" count = str(arcpy.GetCount_management(fc)) x = 0 while x < int(count) + 1: rows = arcpy.SearchCursor(fc, "FID = " + str(x)) arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", "FID = " + str(x)) for row in rows: df.zoomToSelectedFeatures() df.extent = lyr.getSelectedExtent() arcpy.RefreshActiveView() mapping.ExportToJPEG(mxd, r"C:\Temp\Map_" + str(x) + ".jpg", df, df_export_width=3004, df_export_height=2125, world_file=True) print('Exported image',x, 'of', count) x += 1 print("MXD to JPEGs Export successful") print("Thank you!")
... View more