<?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: using arcpy.env.workspace to open a MXD in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-arcpy-env-workspace-to-open-a-mxd/m-p/453290#M35543</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It requires the full path. The MapDocument object does not respect workspaces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000r000000" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000r000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Jun 2012 15:17:31 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-06-18T15:17:31Z</dc:date>
    <item>
      <title>using arcpy.env.workspace to open a MXD</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-env-workspace-to-open-a-mxd/m-p/453289#M35542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So my script was working on Friday but doesn't anymore, and I can't figure out why. Basically, I am running into an error when trying to set the environment workspace and use it to open a MXD. Here is a dumbed down version of the piece of my code that is throwing an error (it throws the same error as what's in my actual code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = "C:/test"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mapdoc = "test.mxd"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(mapdoc)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and here is the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\interact.py", line 558, in OnEditExecClipboard&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec o in __main__.__dict__&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;clipboard&amp;gt;", line 7, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\mixins.py", line 443, in __init__&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(89004, "Invalid MXD filename")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AssertionError: Invalid MXD filename.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I run arcpy.mapping.MapDocument("C:/test/test.mxd") it works fine, so I don't know where things are getting hung up. Please help, and thanks in advance to all for any input.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 14:59:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-env-workspace-to-open-a-mxd/m-p/453289#M35542</guid>
      <dc:creator>JohnNerge</dc:creator>
      <dc:date>2012-06-18T14:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: using arcpy.env.workspace to open a MXD</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-env-workspace-to-open-a-mxd/m-p/453290#M35543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It requires the full path. The MapDocument object does not respect workspaces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000r000000" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000r000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 15:17:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-env-workspace-to-open-a-mxd/m-p/453290#M35543</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-06-18T15:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: using arcpy.env.workspace to open a MXD</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-env-workspace-to-open-a-mxd/m-p/453291#M35544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It requires the full path. The MapDocument object does not respect workspaces.&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000r000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000000r000000&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mathew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, I guess I must have changed something about that between today and Friday, though for the life of me I don't really think I did.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 15:20:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-env-workspace-to-open-a-mxd/m-p/453291#M35544</guid>
      <dc:creator>JohnNerge</dc:creator>
      <dc:date>2012-06-18T15:20:56Z</dc:date>
    </item>
  </channel>
</rss>

