<?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: Set Extent not working. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73202#M5978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arcpy.Extent is an environment variable for geoprocessing tools.&amp;nbsp; See the following help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/environments/output-extent.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/environments/output-extent.htm"&gt;Output Extent (Environment setting)—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To update the data frame extent, you will need to use &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/dataframe-class.htm"&gt;DataFrame &lt;/A&gt;class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Feb 2015 19:19:51 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2015-02-23T19:19:51Z</dc:date>
    <item>
      <title>Set Extent not working.</title>
      <link>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73201#M5977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to set the extent of the ArcMap where I want to add the raster to my ArcMap but this does not work...&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="python" name="code"&gt;#Set the Scale extent arcpy.Extent(147806,3495023,584371,3899368)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked at the ArcGIS 10.1 help about this but not sure which one is the correct way to display them .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 18:56:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73201#M5977</guid>
      <dc:creator>DEAF_PROBERT_68</dc:creator>
      <dc:date>2015-02-23T18:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set Extent not working.</title>
      <link>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73202#M5978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arcpy.Extent is an environment variable for geoprocessing tools.&amp;nbsp; See the following help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/environments/output-extent.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/environments/output-extent.htm"&gt;Output Extent (Environment setting)—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To update the data frame extent, you will need to use &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/dataframe-class.htm"&gt;DataFrame &lt;/A&gt;class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 19:19:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73202#M5978</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-02-23T19:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set Extent not working.</title>
      <link>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73203#M5979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:43:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73203#M5979</guid>
      <dc:creator>DEAF_PROBERT_68</dc:creator>
      <dc:date>2015-02-23T20:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Extent not working.</title>
      <link>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73204#M5980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/8586"&gt;Jake Skinner&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to set the extent numbers in UTM&amp;nbsp; but it would not&amp;nbsp; allow me to... even I set the df as well...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Set the df to refresh the "Set Extent"&lt;/P&gt;&lt;P&gt;df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]&lt;/P&gt;&lt;P&gt;arcpy.env.extent ="MAXOF"&lt;/P&gt;&lt;P&gt;newExtent = df.extent&lt;/P&gt;&lt;P&gt;newExtent.XMin, newExtent.YMin =&amp;nbsp; 210000,360000&lt;/P&gt;&lt;P&gt;newExtent.XMax, newExtent.YMax =&amp;nbsp; 550000,400000&lt;/P&gt;&lt;P&gt;df.extent = newExtent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 16:28:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73204#M5980</guid>
      <dc:creator>DEAF_PROBERT_68</dc:creator>
      <dc:date>2015-02-26T16:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Set Extent not working.</title>
      <link>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73205#M5981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What coordinate system is your Data Frame set to?&amp;nbsp; Also, are you executing this code in the Python window within ArcMap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 17:11:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73205#M5981</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-02-26T17:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Extent not working.</title>
      <link>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73206#M5982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The imagery are set to NAD 1983 UTM Zone 13 N and the&amp;nbsp; code I wrote are done in Pyscripter &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 17:19:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73206#M5982</guid>
      <dc:creator>DEAF_PROBERT_68</dc:creator>
      <dc:date>2015-02-26T17:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set Extent not working.</title>
      <link>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73207#M5983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are running the code in PyScripter, the extent will not update.&amp;nbsp; You can run the code within ArcMap using the Python window.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")

df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
arcpy.env.extent ="MAXOF"
newExtent = df.extent
newExtent.XMin, newExtent.YMin =&amp;nbsp; 210000,360000
newExtent.XMax, newExtent.YMax =&amp;nbsp; 550000,400000
df.extent = newExtent

del mxd&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can update the extent in PyScripter, but you will need to save the MXD.&amp;nbsp; Once you re-open the MXD, the map will be at the new extent.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

mxd = arcpy.mapping.MapDocument(r"C:\data\vector\world\Countries.mxd")

df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
arcpy.env.extent ="MAXOF"
newExtent = df.extent
newExtent.XMin, newExtent.YMin =&amp;nbsp; 210000,360000
newExtent.XMax, newExtent.YMax =&amp;nbsp; 550000,400000
df.extent = newExtent
mxd.save()

del mxd&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:50:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/set-extent-not-working/m-p/73207#M5983</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-10T22:50:38Z</dc:date>
    </item>
  </channel>
</rss>

