<?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: How to get current workspace from tool Environment? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-get-current-workspace-from-tool-environment/m-p/65843#M5405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! Yes, I missed it and thank you for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Aug 2016 18:26:23 GMT</pubDate>
    <dc:creator>AndreaBrugger</dc:creator>
    <dc:date>2016-08-05T18:26:23Z</dc:date>
    <item>
      <title>How to get current workspace from tool Environment?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-current-workspace-from-tool-environment/m-p/65841#M5403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this is a super basic question but I'm not having any luck so far and I am just learning all of this. When I am running a custom tool scripted in python using the ArcCatalog, how do I read in the current workspace environment so I can use it in my script?&amp;nbsp; This assumes before I run the script, I've clicked on the "Environments..." button and entered in the appropriate values for the current workspace and scratch workspace, etc.&amp;nbsp; For parameters, I use something like arcpy.GetParameterAsText(0), but how do I get the environment values that were provided in the script launch window?&amp;nbsp; Every example I find expects me to use something like arcpy.env.workspace = "c:/data/data.mdb", using a hard-coded path. I could create a parameter for the workspace too but it seems like I should be pulling the workspace from the configured environment.&amp;nbsp; Am I going about this wrong?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 18:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-current-workspace-from-tool-environment/m-p/65841#M5403</guid>
      <dc:creator>AndreaBrugger</dc:creator>
      <dc:date>2016-08-05T18:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current workspace from tool Environment?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-current-workspace-from-tool-environment/m-p/65842#M5404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, did you miss this in the arcpy tree &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listenvironments.htm" title="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listenvironments.htm"&gt;ListEnvironments—Help | ArcGIS for Desktop&lt;/A&gt; there are several there such as &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/getsystemenvironment.htm" title="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/getsystemenvironment.htm"&gt;GetSystemEnvironment—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;You should always be setting your environments to begin with even if you think you know where they are set, this is a common area where script, models and builtin tools fail... the environments aren't known, they are in inappropriate folders or geodatabases and the lists go on.&amp;nbsp; If you need a scratch workspace... make one, use it, then delete it when a script process is done and you don't need the contents.&amp;nbsp; Temp is anything but...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 18:21:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-current-workspace-from-tool-environment/m-p/65842#M5404</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-08-05T18:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current workspace from tool Environment?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-get-current-workspace-from-tool-environment/m-p/65843#M5405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! Yes, I missed it and thank you for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 18:26:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-get-current-workspace-from-tool-environment/m-p/65843#M5405</guid>
      <dc:creator>AndreaBrugger</dc:creator>
      <dc:date>2016-08-05T18:26:23Z</dc:date>
    </item>
  </channel>
</rss>

