<?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: Setting DF inset window not behaving right? in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216926#M2301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see a mistake in my desciption of my issue: "I want my inset map to have the same extent as my main data frame" should be "I want my inset map to have the extent indicator in the center of my inset data frame at 1:1,500,000." So, my logic here was just use the same DF.extent as my main DF, then just zoom out to 1:1,500,000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have never been able to use wildcards when using arcpy.mapping.ListDataFrame ie. "main" and "inset". I get "Runtime error &amp;lt;type 'exceptions.IndexError'&amp;gt;: list index out of range." I have always had to declare them through a list: [0], [1], etc. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any additional thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ryan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 May 2011 16:18:46 GMT</pubDate>
    <dc:creator>RyanKelley</dc:creator>
    <dc:date>2011-05-02T16:18:46Z</dc:date>
    <item>
      <title>Setting DF inset window not behaving right?</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216924#M2299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have two data frames. One is an inset map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want my inset map to have the same extent as my main data frame... this works just fine in the arcpy window, but not in my script. Pretty straightforward, but not sure why it's not working... any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DF = MAP.ListDataFrames(MXD)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;newInsetExtent = DF.extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF_inset = MAP.ListDataFrames(MXD)[1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF_inset.extent = newInsetExtent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF_inset.scale = 1500000&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Map ends up with the correct scale of 1500000, but my extent never gets passed. Again, this works perfectly fine in the arcpy window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ryan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 15:34:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216924#M2299</guid>
      <dc:creator>RyanKelley</dc:creator>
      <dc:date>2011-04-28T15:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Setting DF inset window not behaving right?</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216925#M2300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ryan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could not reproduce.&amp;nbsp; There are a couple of things.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) The aspect ratio of your data frames need to be similar otherwise the extents can not be the same - we don't warp the data but fit the extent until the one of the delta Xs or Ys are fitted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) did you save your changes?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code - I have a simple MXD with 2 data frames, the main is 6x6 inches and the inset is 2x2 inches.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MXD = arcpy.mapping.MapDocument(r"C:\Temp\df.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF = arcpy.mapping.ListDataFrames(MXD, "main")[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;newInsetExtent = DF.extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF_inset = arcpy.mapping.ListDataFrames(MXD, "inset")[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF_inset.extent = newInsetExtent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MXD.saveACopy(r"C:\Temp\df2.mxd")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 17:56:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216925#M2300</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2011-04-29T17:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Setting DF inset window not behaving right?</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216926#M2301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see a mistake in my desciption of my issue: "I want my inset map to have the same extent as my main data frame" should be "I want my inset map to have the extent indicator in the center of my inset data frame at 1:1,500,000." So, my logic here was just use the same DF.extent as my main DF, then just zoom out to 1:1,500,000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have never been able to use wildcards when using arcpy.mapping.ListDataFrame ie. "main" and "inset". I get "Runtime error &amp;lt;type 'exceptions.IndexError'&amp;gt;: list index out of range." I have always had to declare them through a list: [0], [1], etc. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any additional thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ryan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 16:18:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216926#M2301</guid>
      <dc:creator>RyanKelley</dc:creator>
      <dc:date>2011-05-02T16:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Setting DF inset window not behaving right?</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216927#M2302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Having this code at the very end of the script (before my PDF export) made this work properly. Maybe because I was going back and forth between Data Frames just once, it was messing something up? The code below workd just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your input Jeff...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy.mapping as MAP&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF = MAP.ListDataFrames(MXD)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...code...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;newInsetExtent = DF.extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF_inset = MAP.ListDataFrames(MXD)[1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF_inset.extent = newInsetExtent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF_inset.scale = 1500000&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 20:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-df-inset-window-not-behaving-right/m-p/216927#M2302</guid>
      <dc:creator>RyanKelley</dc:creator>
      <dc:date>2011-05-02T20:46:41Z</dc:date>
    </item>
  </channel>
</rss>

