<?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: ArcMap 10.2: Save fixed layer extent and set it for multiple ArcMap Documents in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88007#M1029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the suggested workflow ! I found it very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to point out a typo in your code, in line 2 in the excerpt below (and written in red). I believe you meant to write "mxd_to_copy" rather than "mxd".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanted to clear it up in case anyone copies and pastes your code directly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="dp-highlighter"&gt;&lt;DIV class="bar"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;OL class="dp-py" start="1"&gt;&lt;LI class="alt"&gt;&lt;SPAN&gt;&lt;SPAN&gt;mxd_to_copy&amp;nbsp;=&amp;nbsp;arcpy.mapping.MapDocument(r&lt;/SPAN&gt;&lt;SPAN class="string"&gt;"[path&amp;nbsp;to&amp;nbsp;MXD&amp;nbsp;containing&amp;nbsp;the&amp;nbsp;extent&amp;nbsp;you&amp;nbsp;want&amp;nbsp;to&amp;nbsp;copy]"&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class=""&gt;&lt;SPAN&gt;df_to_copy&amp;nbsp;=&amp;nbsp;arcpy.ListDataFrames(&lt;STRONG style="color: #ff0000;"&gt;mxd&lt;/STRONG&gt;)[&lt;SPAN class="number"&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="comment"&gt;#&amp;nbsp;Note:&amp;nbsp;this&amp;nbsp;assumes&amp;nbsp;that&amp;nbsp;there&amp;nbsp;is&amp;nbsp;only&amp;nbsp;one&amp;nbsp;data&amp;nbsp;frame&amp;nbsp;in&amp;nbsp;the&amp;nbsp;mxd.&amp;nbsp;If&amp;nbsp;there&amp;nbsp;are&amp;nbsp;multiple,&amp;nbsp;you&amp;nbsp;can&amp;nbsp;specifiy&amp;nbsp;which&amp;nbsp;to&amp;nbsp;use&amp;nbsp;with&amp;nbsp;a&amp;nbsp;wildcard&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="alt"&gt;&lt;SPAN&gt;extent_to_copy&amp;nbsp;=&amp;nbsp;df_to_copy.extent&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;PRE class="python" style="display: none;"&gt;mxd_to_copy = arcpy.mapping.MapDocument(r"[path to MXD containing the extent you want to copy]") df_to_copy = arcpy.ListDataFrames(mxd)[0] # Note: this assumes that there is only one data frame in the mxd. If there are multiple, you can specifiy which to use with a wildcard extent_to_copy = df_to_copy.extent&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="display: none;"&gt; &lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 May 2017 15:11:14 GMT</pubDate>
    <dc:creator>PraveenBains</dc:creator>
    <dc:date>2017-05-12T15:11:14Z</dc:date>
    <item>
      <title>ArcMap 10.2: Save fixed layer extent and set it for multiple ArcMap Documents</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88003#M1025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I often have to copy the same layer extent for different projects in ArcMap. I am using fixed extents and multiple ArcMap documents to create different sets of maps. However with this method I have to copy each position ("Top", "Left", "Right", "Bottom") separetely and then paste it into the other projects (as illustration I have added the specific box in the Data Frame Properties which I am refering to).&lt;/P&gt;&lt;P&gt;Is there a way to copy the whole extent and therefore a faster approach to my workflow? Any help is kindly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 04:48:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88003#M1025</guid>
      <dc:creator>fd</dc:creator>
      <dc:date>2014-12-24T04:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10.2: Save fixed layer extent and set it for multiple ArcMap Documents</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88004#M1026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there, great question! And an excellent candidate for using the arcpy.mapping module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first step would be to create a list of the mxds you want to modify. Something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

arcpy.env.workspace = r"[path to directory containing your MXDs]"
mapDocList = arcpy.ListFiles("*.mxd")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now that we have that list, you can identify the extent you want to apply to the other MXDs. Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd_to_copy = arcpy.mapping.MapDocument(r"[path to MXD containing the extent you want to copy]")
df_to_copy = arcpy.ListDataFrames(mxd)[0] # Note: this assumes that there is only one data frame in the mxd. If there are multiple, you can specifiy which to use with a wildcard
extent_to_copy = df_to_copy.extent&lt;/PRE&gt;&lt;P&gt;Ok, now you have created an extent object that you will apply to the data frames in your other MXDs. So...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for mapDoc in mapDocList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create an mxd object out of the map doc
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(r"[path to directory containing your MXDs]" + "\\" + mapDoc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create a data frame object to apply the extent to
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df = arcpy.mapping.ListDataFrames(mxd)[0] # See previous note about multiple data frames
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Apply the extent
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.extent = extent_to_copy
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save the map document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.save()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Cleanup the variables
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del mxd, df&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Anyways, the arcpy.mapping module is awesome once you get the hang of it. Esri really hit it out of the park with that one in my humble opinion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Micah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:21:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88004#M1026</guid>
      <dc:creator>MicahBabinski</dc:creator>
      <dc:date>2021-12-10T23:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10.2: Save fixed layer extent and set it for multiple ArcMap Documents</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88005#M1027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hate to bring the bad news, but this will not work. If the data has a setting "Fixed Extent", you will not be able to change the extent through a Python script. It would first require to set the Extent to "Automatic", but this property is not exposed to the dataframe object of arcpy...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14232518776863087 jive_text_macro" jivemacro_uid="_14232518776863087" modifiedtitle="true"&gt;&lt;P&gt;RuntimeError: DataFrameObject: Error in setting extent&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This wold require some ArcObjects coding or setting the extent to Automatic in all your mxd's ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 19:45:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88005#M1027</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-06T19:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10.2: Save fixed layer extent and set it for multiple ArcMap Documents</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88006#M1028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right Xander, but I was not clear from the question if the target data frames have a fixed extent or just the source data frame.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming the target data frames are set to fixed extent, that sounds like a fun bit of ArcObjects research!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 20:01:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88006#M1028</guid>
      <dc:creator>MicahBabinski</dc:creator>
      <dc:date>2015-02-06T20:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10.2: Save fixed layer extent and set it for multiple ArcMap Documents</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88007#M1029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the suggested workflow ! I found it very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to point out a typo in your code, in line 2 in the excerpt below (and written in red). I believe you meant to write "mxd_to_copy" rather than "mxd".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanted to clear it up in case anyone copies and pastes your code directly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="dp-highlighter"&gt;&lt;DIV class="bar"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;OL class="dp-py" start="1"&gt;&lt;LI class="alt"&gt;&lt;SPAN&gt;&lt;SPAN&gt;mxd_to_copy&amp;nbsp;=&amp;nbsp;arcpy.mapping.MapDocument(r&lt;/SPAN&gt;&lt;SPAN class="string"&gt;"[path&amp;nbsp;to&amp;nbsp;MXD&amp;nbsp;containing&amp;nbsp;the&amp;nbsp;extent&amp;nbsp;you&amp;nbsp;want&amp;nbsp;to&amp;nbsp;copy]"&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class=""&gt;&lt;SPAN&gt;df_to_copy&amp;nbsp;=&amp;nbsp;arcpy.ListDataFrames(&lt;STRONG style="color: #ff0000;"&gt;mxd&lt;/STRONG&gt;)[&lt;SPAN class="number"&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="comment"&gt;#&amp;nbsp;Note:&amp;nbsp;this&amp;nbsp;assumes&amp;nbsp;that&amp;nbsp;there&amp;nbsp;is&amp;nbsp;only&amp;nbsp;one&amp;nbsp;data&amp;nbsp;frame&amp;nbsp;in&amp;nbsp;the&amp;nbsp;mxd.&amp;nbsp;If&amp;nbsp;there&amp;nbsp;are&amp;nbsp;multiple,&amp;nbsp;you&amp;nbsp;can&amp;nbsp;specifiy&amp;nbsp;which&amp;nbsp;to&amp;nbsp;use&amp;nbsp;with&amp;nbsp;a&amp;nbsp;wildcard&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="alt"&gt;&lt;SPAN&gt;extent_to_copy&amp;nbsp;=&amp;nbsp;df_to_copy.extent&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;PRE class="python" style="display: none;"&gt;mxd_to_copy = arcpy.mapping.MapDocument(r"[path to MXD containing the extent you want to copy]") df_to_copy = arcpy.ListDataFrames(mxd)[0] # Note: this assumes that there is only one data frame in the mxd. If there are multiple, you can specifiy which to use with a wildcard extent_to_copy = df_to_copy.extent&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="display: none;"&gt; &lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 May 2017 15:11:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-10-2-save-fixed-layer-extent-and-set-it-for/m-p/88007#M1029</guid>
      <dc:creator>PraveenBains</dc:creator>
      <dc:date>2017-05-12T15:11:14Z</dc:date>
    </item>
  </channel>
</rss>

