<?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 arcpy.env.workspace cannot be defined  in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-env-workspace-cannot-be-defined/m-p/144799#M11278</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create a simple python script that would be used as a tool with the functionality of receiving 1 input of a switch number (working on an electric grid system) and the tool would provide as an output the station/substation adjacent to the switch, at first I thought something like SelectByLocation Radius or SpatialJoin would suffice but there is a third variable that needs to be taken into account, both the switches and the stations/substation are located within a building polygon, so I would need to confirm that the feature class line (switch) and the feature class point (station/substation) are within the same polygon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have a rough idea of making this work by using a dictionary and&amp;nbsp;SelecbyAttribute/Location tools but the main problem is that the data set I'm working on is hosted on my companies local server, i.e when I created my version of the main webmap we were working on, the gdb is located online and not on a local file in my computer, the problem I'm having is that almost all of the online tutorials and learning materials assume that you write a python script starting off with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = r"C:\Yourfile\YourGDB.gdb"&lt;/P&gt;&lt;P&gt;The problem I'm having is that the only local gdb file i have on my computer is empty, which is the one which is auto created everytime you make a project and I've been unable so far to set any scripts to work with the data from the map I'm working on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is Appreciated&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Sep 2020 08:31:52 GMT</pubDate>
    <dc:creator>DrigoHoreis</dc:creator>
    <dc:date>2020-09-08T08:31:52Z</dc:date>
    <item>
      <title>arcpy.env.workspace cannot be defined</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-env-workspace-cannot-be-defined/m-p/144799#M11278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create a simple python script that would be used as a tool with the functionality of receiving 1 input of a switch number (working on an electric grid system) and the tool would provide as an output the station/substation adjacent to the switch, at first I thought something like SelectByLocation Radius or SpatialJoin would suffice but there is a third variable that needs to be taken into account, both the switches and the stations/substation are located within a building polygon, so I would need to confirm that the feature class line (switch) and the feature class point (station/substation) are within the same polygon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have a rough idea of making this work by using a dictionary and&amp;nbsp;SelecbyAttribute/Location tools but the main problem is that the data set I'm working on is hosted on my companies local server, i.e when I created my version of the main webmap we were working on, the gdb is located online and not on a local file in my computer, the problem I'm having is that almost all of the online tutorials and learning materials assume that you write a python script starting off with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = r"C:\Yourfile\YourGDB.gdb"&lt;/P&gt;&lt;P&gt;The problem I'm having is that the only local gdb file i have on my computer is empty, which is the one which is auto created everytime you make a project and I've been unable so far to set any scripts to work with the data from the map I'm working on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is Appreciated&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2020 08:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-env-workspace-cannot-be-defined/m-p/144799#M11278</guid>
      <dc:creator>DrigoHoreis</dc:creator>
      <dc:date>2020-09-08T08:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.env.workspace cannot be defined</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-env-workspace-cannot-be-defined/m-p/144800#M11279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't have to specify a workspace.&amp;nbsp; It is useful to specify if your read and write locations are going to be the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The alternative is to specify paths to the data, even if you have to temporarily make copies to in_memory or 'memory' or to use temporary workspaces using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/classes/envmanager.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/classes/envmanager.htm"&gt;EnvManager—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you remove the idea of setting a workspace as your first line... what does your problem boil down to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2020 09:43:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-env-workspace-cannot-be-defined/m-p/144800#M11279</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-09-08T09:43:48Z</dc:date>
    </item>
  </channel>
</rss>

