<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Iterative Zoom to and export to JPG in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244537#M18994</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;figures it would be a simple syntax error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Mar 2015 19:15:19 GMT</pubDate>
    <dc:creator>nathanbush</dc:creator>
    <dc:date>2015-03-03T19:15:19Z</dc:date>
    <item>
      <title>Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244531#M18988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I have been trying to string together a simple script to read through a Grid.shp, Zoom to each feature, Export that image to a jpg with a world file with a filename based on the Grid index of the iterated row.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i tried to make this with Modelbuilder but it lacks the functionality it seems &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am absolutely green when it comes to python and I would greatly appreciate a nudge in the right direction. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 15:40:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244531#M18988</guid>
      <dc:creator>AnthonyTimpson2</dc:creator>
      <dc:date>2011-11-14T15:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244532#M18989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Anthony,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example on how to do this.&amp;nbsp; What the script does is iterate through a shapefile called 'Grid' and adjusts the MXDs extent to each feature in the GRID shapefile, and then exports the map to a JPG based on that extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
from arcpy import mapping
env.workspace = r"C:\temp\python"

mxd = mapping.MapDocument(r"C:\DATA\Philadelphia.mxd")

fc = "GRID.shp"
count = str(arcpy.GetCount_management(fc))

x = 1

while x &amp;lt; int(count) + 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(fc, "OID = " + str(x))
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmin = row.shape.extent.XMin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymin = row.shape.extent.YMin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmax = row.shape.extent.XMax
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymax = row.shape.extent.YMax
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df = arcpy.mapping.ListDataFrames(mxd)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent = df.extent
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent.XMin, newExtent.YMin = xmin, ymin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent.XMax, newExtent.YMax = xmax, ymax
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = newExtent
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapping.ExportToJPEG(mxd, r"C:\temp\python\JPEG_" + str(x) + ".jpg")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "successfully printed JPG"
&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:12:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244532#M18989</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T12:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244533#M18990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You Sir are a Steely Eyed Missile man. Thank you!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 19:49:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244533#M18990</guid>
      <dc:creator>AnthonyTimpson2</dc:creator>
      <dc:date>2011-11-14T19:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244534#M18991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jake, you are a gem. It worked perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wanted to Export the JGW world file for JPEGs too so I modified it and it saved many days of manual work. Thumbs up&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;mapping.ExportToJPEG(mxd, r"C:\temp\Map_" + str(x) + ".jpg", df, df_export_width=2209, df_export_height=1663, world_file=True)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 02:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244534#M18991</guid>
      <dc:creator>Thiru_P</dc:creator>
      <dc:date>2012-08-10T02:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244535#M18992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Jake, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm also pretty new to Python, but iterating through many polygons within my shapefile and exporting to JPEGs is exactly what I need to do. I've copied your script, but I keep coming up with the attribute error 'Extent' object has no attribute 'Xmin'. My shapefile only has 4 fields (FID, Shape*, Unit, Hectares), am I missing something here? &lt;/P&gt;&lt;P&gt;Any help is good help. &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 18:53:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244535#M18992</guid>
      <dc:creator>nathanbush</dc:creator>
      <dc:date>2015-03-03T18:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244536#M18993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Python, case matters. XMin (a defined property of Extent) is different from Xmin (something unknown). You can see the exact list of valid Extent properties &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Extent/018z00000072000000/"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 18:57:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244536#M18993</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-03-03T18:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244537#M18994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;figures it would be a simple syntax error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 19:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244537#M18994</guid>
      <dc:creator>nathanbush</dc:creator>
      <dc:date>2015-03-03T19:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244538#M18995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake, &lt;/P&gt;&lt;P&gt;Thanks for the script, its almost doing exactly what I want it to do. Thanks Darren for your correction. &lt;/P&gt;&lt;P&gt;I've got the script to run and iterate through each row and produce a JPEG. However, the JPEGs are all blank - just a white space JPEG of 23 KB. I was thinking that the iteration is not allowing Arc to redraw the map and taking a snapshot of a blank dataframe before the orthophoto and polygons had time to draw. I added a "time.sleep" of 20 seconds (didn't work), so I increased to 60 sec (didn't work). I've also tried exporting to PDFs, but same issue. &lt;/P&gt;&lt;P&gt;Any ideas??? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nate&lt;/P&gt;&lt;P&gt;Here's the Script: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import time&lt;/P&gt;&lt;P&gt;import arcpy &lt;/P&gt;&lt;P&gt;from arcpy import env&amp;nbsp; &lt;/P&gt;&lt;P&gt;from arcpy import mapping&amp;nbsp; &lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument(r"N:\Data\My_map.mxd")&amp;nbsp; &lt;/P&gt;&lt;P&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&amp;nbsp; &lt;/P&gt;&lt;P&gt;fc = r"N:\Data\IWMMunits.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;count = str(arcpy.GetCount_management(fc))&amp;nbsp; &lt;/P&gt;&lt;P&gt;x = 0&amp;nbsp; &lt;/P&gt;&lt;P&gt;while x &amp;lt; int(count) + 1:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(fc, "FID = " + str(x))&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmin = row.shape.extent.XMin&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymin = row.shape.extent.YMin&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmax = row.shape.extent.XMax&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymax = row.shape.extent.YMax&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename = row.getValue("Unit_1") &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df = arcpy.mapping.ListDataFrames(mxd)[0]&amp;nbsp; @&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent = df.extent&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent.XMin, newExtent.YMin = xmin, ymin&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent.XMax, newExtent.YMax = xmax, ymax&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = newExtent&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(60)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapping.ExportToJPEG(mxd,r"N:\Data\Test_JPEGS\{0}.jpg".format(filename))&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "successfully printed JPG"&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 13:12:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244538#M18995</guid>
      <dc:creator>nathanbush</dc:creator>
      <dc:date>2015-03-04T13:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244539#M18996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the 'filename', make sure the name does not contain any spaces, special characters, or begin with a number.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 13:50:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244539#M18996</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-03-04T13:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244540#M18997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the timely response. I'm still getting blank JPEGs. &lt;/P&gt;&lt;P&gt;I've taken a subset of my data and removed any special characters in the rows within the specified fieldname (Unit1) &lt;/P&gt;&lt;P&gt;The attribute table is simply "FID", "Shape","Unit1", "Hectares", "Shape_Leng", "Shape_Area" &lt;/P&gt;&lt;P&gt;"Unit1" is the field name I want to iterate through and also will be used to name the JPEGs, ex: "CT001GM.jpg"&amp;nbsp; &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;FID&lt;/TD&gt;&lt;TD&gt;Shape&lt;/TD&gt;&lt;TD&gt;Unit1&lt;/TD&gt;&lt;TD&gt;Hectares&lt;/TD&gt;&lt;TD&gt;Shape_Leng&lt;/TD&gt;&lt;TD&gt;Shape_Area&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Polygon&lt;/TD&gt;&lt;TD&gt;CT001GM&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0.084042&lt;/TD&gt;&lt;TD&gt;-0.000311&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import time&lt;/P&gt;&lt;P&gt;import arcpy &lt;/P&gt;&lt;P&gt;from arcpy import env&amp;nbsp; &lt;/P&gt;&lt;P&gt;from arcpy import mapping&amp;nbsp; &lt;/P&gt;&lt;P&gt;env.workspace = r"N:\NWRS\DNR\Coastal_Network"&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument(r"N:\NWRS\DNR\Coastal_Network\IWMM.mxd")&amp;nbsp; &lt;/P&gt;&lt;P&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&amp;nbsp; &lt;/P&gt;&lt;P&gt;fc = r"N:\NWRS\DNR\Coastal_Network\Test2.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;count = str(arcpy.GetCount_management(fc))&amp;nbsp; &lt;/P&gt;&lt;P&gt;x = 0&amp;nbsp; &lt;/P&gt;&lt;P&gt;while x &amp;lt; int(count) + 1:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(fc, "FID = " + str(x))&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmin = row.shape.extent.XMin&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymin = row.shape.extent.YMin&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmax = row.shape.extent.XMax&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymax = row.shape.extent.YMax&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename = row.getValue("Unit1")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;# this should be the attribute field name correct? &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df = arcpy.mapping.ListDataFrames(mxd)[0]&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent = df.extent&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent.XMin, newExtent.YMin = xmin, ymin&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent.XMax, newExtent.YMax = xmax, ymax&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = newExtent&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(60)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapping.ExportToJPEG(mxd,r"N:\NWRS\DNR\Coastal_Network\Test_JPEGS\{0}.jpg".format(filename))&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "successfully printed JPG"&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 14:58:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244540#M18997</guid>
      <dc:creator>nathanbush</dc:creator>
      <dc:date>2015-03-04T14:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244541#M18998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is some data you can test with. Extract the zip file to the following location:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\temp\python\userdata&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can run the code below.&amp;nbsp; It should successfully print out 4 JPGs to the same directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env 
from arcpy import mapping 

env.workspace = r"C:\temp\python\userdata"

mxd = arcpy.mapping.MapDocument(r"C:\temp\python\userdata\IWMM.mxd") 
df = arcpy.mapping.ListDataFrames(mxd)[0] 

fc = "GRID.shp"&amp;nbsp;&amp;nbsp; 
count = str(arcpy.GetCount_management(fc)) 

x = 0 
while x &amp;lt; int(count) + 1: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(fc, "FID = " + str(x))&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows: 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmin = row.shape.extent.XMin 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymin = row.shape.extent.YMin 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmax = row.shape.extent.XMax 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ymax = row.shape.extent.YMax&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename = row.getValue("Unit1")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df = arcpy.mapping.ListDataFrames(mxd)[0] 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent = df.extent 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent.XMin, newExtent.YMin = xmin, ymin 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newExtent.XMax, newExtent.YMax = xmax, ymax 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = newExtent 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapping.ExportToJPEG(mxd,r"C:\temp\python\userdata\{0}.jpg".format(filename)) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "successfully printed JPG" 
&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1

del mxd, row, rows&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:12:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244541#M18998</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T12:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244542#M18999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jake, it worked on my data too! &lt;/P&gt;&lt;P&gt;Is there a way to get the polygons to show up too, since its parcel boundaries - need that displayed as well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;again, thanks for tolerating my neediness.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 19:29:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244542#M18999</guid>
      <dc:creator>nathanbush</dc:creator>
      <dc:date>2015-03-04T19:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244543#M19000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just add the parcels to the map, save the MXD and then run the code.&amp;nbsp; The parcels should then be included.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 19:51:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244543#M19000</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-03-04T19:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative Zoom to and export to JPG</title>
      <link>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244544#M19001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, I didn't save the mxd before I ran the code. &lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 19:59:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterative-zoom-to-and-export-to-jpg/m-p/244544#M19001</guid>
      <dc:creator>nathanbush</dc:creator>
      <dc:date>2015-03-04T19:59:02Z</dc:date>
    </item>
  </channel>
</rss>

