<?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: ArcPy: Issue with MXD=&amp;quot;CURRENT&amp;quot; and DataFrame for Tool in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377754#M4013</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I seemed to have fixed the problem by checking the boxes "Always run in foreground" and "Run Python script in process" under the tool properties.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Sep 2010 13:16:35 GMT</pubDate>
    <dc:creator>RyanKelley</dc:creator>
    <dc:date>2010-09-27T13:16:35Z</dc:date>
    <item>
      <title>ArcPy: Issue with MXD="CURRENT" and DataFrame for Tool</title>
      <link>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377753#M4012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have written a script that calculates acres or miles for layers in my MXD.&amp;nbsp; When I copy and paste the code from my Python textfile into the arcpy window, it runs great and executes (I have static arguments) when testing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when I turn this script into a tool, I get an error (000714)... which basically tells you there is an error with your script. I have tried both system arguments and static arguments. I do have bacground processing turned off.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After trying to troubleshoot the issue, it does not like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MXD = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DF = arcpy.mapping.ListDataFrames(MXD)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I point my MXD to an existing MXD on disk, it gets through that line of code, but still stops at the DF part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess I am not toally sure how the tool talks top the MXD.&amp;nbsp; It would only make sense to me that having a "CURRENT" mxd would allow for buttons, tools, etc. to execute in any ArcMap session.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ryan Kelley&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;OR/WA BLM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Portland, OR&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 15:45:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377753#M4012</guid>
      <dc:creator>RyanKelley</dc:creator>
      <dc:date>2010-09-24T15:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy: Issue with MXD="CURRENT" and DataFrame for Tool</title>
      <link>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377754#M4013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I seemed to have fixed the problem by checking the boxes "Always run in foreground" and "Run Python script in process" under the tool properties.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 13:16:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377754#M4013</guid>
      <dc:creator>RyanKelley</dc:creator>
      <dc:date>2010-09-27T13:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy: Issue with MXD="CURRENT" and DataFrame for Tool</title>
      <link>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377755#M4014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Ryan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was hoping you had background processing enabled.&amp;nbsp; But you don't.&amp;nbsp; That must be turned off for CURRENT to work within a script tool.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Everything you say should be working the way you expect it to. Could you please send me your script/ script tool to &lt;/SPAN&gt;&lt;A href="mailto:jbarrette@esri.com"&gt;jbarrette@esri.com&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; I'd like to look at it a bit more.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 13:38:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377755#M4014</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2010-09-27T13:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy: Issue with MXD="CURRENT" and DataFrame for Tool</title>
      <link>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377756#M4015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oops - I see you found the solution.&amp;nbsp; Great job!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "always run in foreground" option was specifically added due to CURRENT.&amp;nbsp; Current uses the application in memory and if you run in background, the current application can't be referenced.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 13:40:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcpy-issue-with-mxd-quot-current-quot-and/m-p/377756#M4015</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2010-09-27T13:40:52Z</dc:date>
    </item>
  </channel>
</rss>

