<?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 Setting Active Data Frame in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199733#M2130</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am writing several python scripts for a map automation and export tool.&amp;nbsp; One of the functions of the tool is to take csv files from a provided path and Make a XY Event layers.&amp;nbsp; The problem is that I have several data frames and I want to distribute the XY Event layers properly among those data frames. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have searched the resource center and I have not found anything about activating a specific data frame using python script.&amp;nbsp; Is there a way to do that?&amp;nbsp; Or can I tell arcpy.MakeXYEventLayer_management to put the event layer in a specific data frame?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate any ideas on the matter.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Jan 2011 14:00:47 GMT</pubDate>
    <dc:creator>JohnStephens</dc:creator>
    <dc:date>2011-01-03T14:00:47Z</dc:date>
    <item>
      <title>Setting Active Data Frame</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199733#M2130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am writing several python scripts for a map automation and export tool.&amp;nbsp; One of the functions of the tool is to take csv files from a provided path and Make a XY Event layers.&amp;nbsp; The problem is that I have several data frames and I want to distribute the XY Event layers properly among those data frames. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have searched the resource center and I have not found anything about activating a specific data frame using python script.&amp;nbsp; Is there a way to do that?&amp;nbsp; Or can I tell arcpy.MakeXYEventLayer_management to put the event layer in a specific data frame?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate any ideas on the matter.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jan 2011 14:00:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199733#M2130</guid>
      <dc:creator>JohnStephens</dc:creator>
      <dc:date>2011-01-03T14:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Active Data Frame</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199734#M2131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes. The &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/MapDocument/00s30000000n000000/"&gt;MapDocument class has the activeView property&lt;/A&gt;&lt;SPAN&gt; for exactly this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 03:39:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199734#M2131</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-01-04T03:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Active Data Frame</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199735#M2132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first code sample in the MapDocument Class help shows how to do this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/MapDocument/00s30000000n000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/MapDocument/00s30000000n000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 15:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199735#M2132</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2011-01-04T15:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Active Data Frame</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199736#M2133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks.&amp;nbsp; I saw that yesterday, but I was trying to do dFrame = mxd.activeView instead of vice versa.&amp;nbsp; I appreciate it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 17:36:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199736#M2133</guid>
      <dc:creator>JohnStephens</dc:creator>
      <dc:date>2011-01-04T17:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Active Data Frame</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199737#M2134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks.&amp;nbsp; I saw that yesterday, but I was trying to do dFrame = mxd.activeView instead of vice versa.&amp;nbsp; I appreciate it.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You have to do a loop and isolate the active data frame. The script below will get the active view (active data frame....) only if you are in Data View and not in Layout View. It might not be the best way. I'm open to better ways....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are in Layout View, the returned value for "currentmxd.activeView" is, rather unhelpfully, "PAGE_LAYOUT"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An "activeDataFrame" property for mapdocument that didn't care whether you were in Data View or Layout View would be extremely handy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't at this time know how to get the Active View if you are in Page Layout. If anyone does, I'd love to hear about it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;currmxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dflist = arcpy.mapping.ListDataFrames(currmxd,"*")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for df in dflist:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if df.name == currmxd.activeView:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; activedf = df&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2011 19:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199737#M2134</guid>
      <dc:creator>RandyMcGregor</dc:creator>
      <dc:date>2011-01-24T19:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Active Data Frame</title>
      <link>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199738#M2135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have added a r/o MapDocument.activeDataFrame property to the 10.1 release.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 14:54:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/setting-active-data-frame/m-p/199738#M2135</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2011-01-25T14:54:32Z</dc:date>
    </item>
  </channel>
</rss>

