<?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: How do I set an MXD's full extent programmatically using arcpy? in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758822#M5163</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;I mean thread of course !&lt;/P&gt;&lt;P&gt;Sorry for my bad english,&lt;/P&gt;&lt;P&gt;Have a great day,&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jun 2015 12:10:49 GMT</pubDate>
    <dc:creator>FrédéricPRALLY</dc:creator>
    <dc:date>2015-06-23T12:10:49Z</dc:date>
    <item>
      <title>How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758812#M5153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="j-post-author"&gt;&lt;/SPAN&gt;I am using arcpy for 10.2 and am able to set the &lt;STRONG&gt;initial extent&lt;/STRONG&gt; of the map using the dataframe's extent property. This is the initial extent that the map comes up at when the MXD is loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I set the &lt;STRONG&gt;full extent&lt;/STRONG&gt; programmatically&lt;STRONG&gt; &lt;/STRONG&gt;using arcpy?&lt;/P&gt;&lt;P&gt;This article describes how to do it in ArcGIS Desktop 10.2: &lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00660000043w000000" rel="nofollow" target="_blank"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also, the full extent shows up right next to the initial extent in ArcGIS Server when an mxd is published as a service. It feels like the setting is so close yet I have spent far too much time trying to decipher ESRI help articles to figure this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be clear again:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Initial Extent: &lt;/STRONG&gt;initial zoomed area when an mxd is opened up and a map documents dataframes extent value:&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/P&gt;&lt;P&gt;newExtent = df.extent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Full Extent:&lt;/STRONG&gt; area that is zoomed to by clicking the Full Extent(globe icon) button in ArcGIS Desktop 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 13:26:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758812#M5153</guid>
      <dc:creator>NeilErickson</dc:creator>
      <dc:date>2014-07-09T13:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758813#M5154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following python code will achieve what you want. It cycles through all the layers getting their extents and placing them in a temporary featureclass which you can then get the extent of and zoom to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14049241629797325 jive_text_macro" jivemacro_uid="_14049241629797325"&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Stop temporary layer being loaded into map&lt;/P&gt;
&lt;P&gt;arcpy.env.addOutputsToMap=False&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Create a list of layers in map document&lt;/P&gt;
&lt;P&gt;mapdoc = arcpy.mapping.MapDocument("CURRENT")&lt;/P&gt;
&lt;P&gt;list =arcpy.mapping.ListLayers(mapdoc)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# A list of extents&lt;/P&gt;
&lt;P&gt;extentList = []&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Cycle through layers grabbing extents, converting them into&lt;/P&gt;
&lt;P&gt;# polygons and adding them to extentList&lt;/P&gt;
&lt;P&gt;for layer in list:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not layer.isGroupLayer:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(layer.dataSource)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = desc.extent&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array = arcpy.Array([ext.upperLeft,ext.upperRight,ext.lowerRight,ext.lowerLeft])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extentList.append(arcpy.Polygon(array))&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Create a temporary FeatureClass from the polygons&lt;/P&gt;
&lt;P&gt;arcpy.CopyFeatures_management(extentList,r"in_memory\temp")&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Get extent of this temporary layer and zoom to its extent&lt;/P&gt;
&lt;P&gt;desc = arcpy.Describe(r"in_memory\temp")&lt;/P&gt;
&lt;P&gt;ext = desc.extent&lt;/P&gt;
&lt;P&gt;mapdoc.activeDataFrame.extent = ext&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Clean up&lt;/P&gt;
&lt;P&gt;arcpy.Delete_management(r"in_memory\temp")&lt;/P&gt;
&lt;P&gt;del ext, desc, list, array, extentList, mapdoc&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 16:43:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758813#M5154</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2014-07-09T16:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758814#M5155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Duncan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. This script looks like it only sets the initial extent and not the full extent. Great code though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be clear, the 'intial extent' of a map document is the dataframes extent property which I am aware of how to use. I need the elusive 'full extent'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 16:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758814#M5155</guid>
      <dc:creator>NeilErickson</dc:creator>
      <dc:date>2014-07-09T16:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758815#M5156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The full extent is the extent of all the layers.&amp;nbsp; If Duncan's code determines the minima and maxima of the associated layers, then that is the full extent.&amp;nbsp; There is no otherway to obtain said information within arcpy or arcpy.mapping other than to cycle through the data and determine it iteratively&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 17:33:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758815#M5156</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-09T17:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758816#M5157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I am not mistaken, &lt;A href="https://community.esri.com/migrated-users/44085"&gt;Neil Erickson&lt;/A&gt;‌is looking for a way to set a custom full extent in his data frame (for use in the Full Extent button). This is a property held by the data frame that doesn't change as you pan and zoom. This setting cannot be modified in Python. It is only able to be set through the GUI or ArcObjects. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 class="dtH1" style="color: #003399; font-size: 14px; font-family: Verdana, Arial, Helvetica, sans-serif; margin-bottom: 0.4em; margin-top: 0.4em;"&gt;IActiveView.FullExtent Property:&lt;/H1&gt;&lt;P&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0012000001n2000000" title="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0012000001n2000000"&gt;ArcObjects 10 .NET SDK Help&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 17:41:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758816#M5157</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2014-07-09T17:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758817#M5158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the information, even if it's a bummer for me &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt; I guess i'll have to work around it. Thanks. Could you put this in as an idea for future versions of arcpy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 18:02:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758817#M5158</guid>
      <dc:creator>NeilErickson</dc:creator>
      <dc:date>2014-07-09T18:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758818#M5159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the site where you can do that &lt;A href="http://ideas.arcgis.com/" title="http://ideas.arcgis.com/"&gt;Esri Arcgis Ideas | Ideas Submission Portal&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 18:19:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758818#M5159</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-09T18:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758819#M5160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 13:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758819#M5160</guid>
      <dc:creator>NeilErickson</dc:creator>
      <dc:date>2014-07-10T13:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758820#M5161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on this &lt;SPAN style="text-decoration: line-through;"&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/101304"&gt;threat&lt;/A&gt;&lt;/SPAN&gt; &lt;A _jive_internal="true" href="https://community.esri.com/thread/101304"&gt;thread &lt;/A&gt;you can now use the tool &lt;A href="http://www.arcgis.com/home/item.html?id=782fcc5468c64c948f41755247df4554"&gt;Modify full extent mxd&lt;/A&gt;​ using ArcGIS for Desktop 10.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enjoy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:37:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758820#M5161</guid>
      <dc:creator>FrédéricPRALLY</dc:creator>
      <dc:date>2015-06-23T11:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758821#M5162</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/4211"&gt;Frédéric PRALLY&lt;/A&gt; I am assuming you meant &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;thread &lt;/STRONG&gt;&lt;/SPAN&gt;and not &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;threat&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; We wouldn't want anyone getting ideas on how to initiate&amp;nbsp; or expedite enhancement requests&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 12:02:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758821#M5162</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-06-23T12:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set an MXD's full extent programmatically using arcpy?</title>
      <link>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758822#M5163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;I mean thread of course !&lt;/P&gt;&lt;P&gt;Sorry for my bad english,&lt;/P&gt;&lt;P&gt;Have a great day,&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 12:10:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/how-do-i-set-an-mxd-s-full-extent-programmatically/m-p/758822#M5163</guid>
      <dc:creator>FrédéricPRALLY</dc:creator>
      <dc:date>2015-06-23T12:10:49Z</dc:date>
    </item>
  </channel>
</rss>

