<?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: error: global name 'Primary_OH' is not defined in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750570#M57945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;i can put a print statement but what do you want me to have printed out? I think that the error is due to line 77 but not sure.&lt;/P&gt;&lt;P&gt;This is the error that i get&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/477156_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Dec 2019 14:06:17 GMT</pubDate>
    <dc:creator>RickHawkins</dc:creator>
    <dc:date>2019-12-30T14:06:17Z</dc:date>
    <item>
      <title>error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750565#M57940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to run my program and when i get to this part of the program&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/477113_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the error that global name 'Primary_OH is not defined. Can someone look at my code and tell what i need to do to fix this.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2019 19:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750565#M57940</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-27T19:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750566#M57941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code would be a lot easier to trouble shoot if you paste it into the syntax highlighter rather than providing it as an image.&amp;nbsp; I don't see a reference to&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;Primary_OH in the what you display, but I might be missing it. Somewhere in your code you call it and it should be in quotes is my guess...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2019 20:01:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750566#M57941</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-27T20:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750568#M57943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like line 74 is your problem. You are making a selection on what python thinks is a variable (since it's not quoted)&amp;nbsp;but I don't see any other reference to Primary_OH.&amp;nbsp; Typically, you make a selection against a &lt;A href="https://desktop.arcgis.com/en/arcmap/10.6/tools/data-management-toolbox/make-table-view.htm"&gt;table view&lt;/A&gt; or a &lt;A href="https://desktop.arcgis.com/en/arcmap/10.6/tools/data-management-toolbox/make-feature-layer.htm"&gt;feature layer&lt;/A&gt;, and I don't see&amp;nbsp;either of those&amp;nbsp;as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2019 20:40:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750568#M57943</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-27T20:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750569#M57944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you put a print statement in at line 73 and see what the result is?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2019 20:46:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750569#M57944</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-12-27T20:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750570#M57945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;i can put a print statement but what do you want me to have printed out? I think that the error is due to line 77 but not sure.&lt;/P&gt;&lt;P&gt;This is the error that i get&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/477156_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 14:06:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750570#M57945</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-30T14:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750571#M57946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your original post it said Primary_OH is not defined and now it says Primary_UG is not defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The print statement before the SelectLayerByAttribute call is just a troubleshooting technique to see what value is being passed if any.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 14:11:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750571#M57946</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-12-30T14:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750572#M57947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I realized there is a variable called my Map that is not really being used in your script.&lt;BR /&gt;Anyway, in the top of your script, try to define these variables as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;from&lt;/SPAN&gt; tkinter &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;import&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;*&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;from&lt;/SPAN&gt; tkinter &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;import&lt;/SPAN&gt; messagebox
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;import&lt;/SPAN&gt; Tkinter&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;,&lt;/SPAN&gt; arcpy

myMap &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;"C:/GISMAPS/LUS Map.mxd"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit;"&gt;#myMap = arcpy.mapping.MapDocument("CURRENT")
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/CODE&gt;


&lt;SPAN style="color: #999999;"&gt;# Referencing variables here -------------------------&lt;/SPAN&gt;
Primary_OH_path = &lt;SPAN style="color: #99cc00;"&gt;r"C:\&amp;lt;your_path&amp;gt;\&amp;lt;your_gdb.gdb&amp;gt;\Primary_OH" &lt;/SPAN&gt;
Primary_OH = arcpy.MakeFeatureLayer_management(Primary_OH_path, &lt;SPAN style="color: #99cc00;"&gt;"Primary_OH"&lt;/SPAN&gt;)

Primary_UG_path = &lt;SPAN style="color: #99cc00;"&gt;r"C:\&amp;lt;your_path&amp;gt;\&amp;lt;your_gdb.gdb&amp;gt;\Primary_UG"&lt;/SPAN&gt;
Primary_UG = arcpy.MakeFeatureLayer_management(Primary_UG_path, &lt;SPAN style="color: #99cc00;"&gt;"Primary_UG"&lt;/SPAN&gt;)&lt;CODE&gt;&lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit;"&gt;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:52:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750572#M57947</guid>
      <dc:creator>Javier_AntonioEscudero</dc:creator>
      <dc:date>2021-12-12T07:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750573#M57948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Line 77 &amp;amp; 85 are going to give you problems every time:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;# line 77:

arcpy.SelectLayerByAttribute_management(Primary_OH, "", Expression)‍‍‍

# line 85:

arcpy.SelectLayerByAttribute_management(Primary_UG, "", "[FEEDERID] = '2050'")
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Primary_OH and Primary_UG are never defined as variables in your script; when python reads a string that is not within quotes, it treats that string as a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; x &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

  File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-1-ea8c3abaaaf7&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; x &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

NameError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; name &lt;SPAN class="string token"&gt;'x'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; defined


x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# value of x is now defined&lt;/SPAN&gt;

 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; x &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'x equals zero'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Nope; x does not equal zero...'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    
Nope&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; x does &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; equal zero&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍  &lt;SPAN class="comment token"&gt;# the result of the print() function...&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:52:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750573#M57948</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-12T07:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750574#M57949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Javier,&lt;/P&gt;&lt;P&gt;I know about ..mxd files but do not know about .gdb files. Is that what you are telling me to put in the Primary_OH_path. Where would the .gdb be located? I do not see one when i search C: drive&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 15:31:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750574#M57949</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-30T15:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750575#M57950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe,&lt;/P&gt;&lt;P&gt;I guess i will have to change the lines to some other command. What i am trying to do here is go to the properties of a layer and create a definition query (i.e. -&amp;nbsp; [FEEDERID] = "2050") and turn off all of the feeders for that layer (Primary OH) that are not numbered 2050. Am i doing this wrong? Is there another way to do this?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 15:40:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750575#M57950</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-30T15:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750576#M57951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rick,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The gdb file (File Geodatabase) is the most popular container of data in ArcGIS. However, mxd files can contain multiples types of files and containers (Data sources).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to get the Primary_OH_Path of yout layer follow these steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Open your map document&amp;nbsp;"C:/GISMAPS/LUS Map.mxd"&lt;/LI&gt;&lt;LI&gt;Clic on Primary_OH layer &lt;EM&gt;properties&amp;nbsp;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="376" src="https://community.esri.com/legacyfs/online/477173_pastedImage_2.png" width="398" /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Go to &lt;EM&gt;Source&lt;/EM&gt; tab and explore data source properties of the layer&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" height="300" src="https://community.esri.com/legacyfs/online/477174_pastedImage_3.png" width="473" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 15:43:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750576#M57951</guid>
      <dc:creator>Javier_AntonioEscudero</dc:creator>
      <dc:date>2019-12-30T15:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750577#M57952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Javier,&lt;/P&gt;&lt;P&gt;When i do that i get the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/477175_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;There is no .gdb database.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 15:53:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750577#M57952</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-30T15:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750578#M57953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should copy the data to a file gdb from the personal geodatabase that you are currently using as ESRI is migrating to Pro which does not support personal geodatabases that you are using.&amp;nbsp; File geodatabases can be used in both ArcMap (32-bit) and Pro (64-bit).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 15:58:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750578#M57953</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-12-30T15:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750579#M57954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks everyone for you help. i will see what i need to do to copy the data to a .gdb file.&lt;/P&gt;&lt;P&gt;Will get back with you when this is completed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 16:02:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750579#M57954</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-30T16:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750580#M57955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. It does not matter. The container of data is a Personal Geodatabase, is so similar to File Geodatabase&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;&lt;/SPAN&gt;&lt;/CODE&gt;
&lt;SPAN style="color: #999999; border: 0px; font-weight: inherit;"&gt;# Primary OH Path
&lt;/SPAN&gt;geodatabase = &lt;SPAN style="color: #99cc00;"&gt;"C:\gismaps\LusData.mdb"&lt;/SPAN&gt;
dataset = &lt;SPAN style="color: #99cc00;"&gt;"ElectricData"&lt;/SPAN&gt;
feature_class = &lt;SPAN style="color: #99cc00;"&gt;"PriOHElectricLineSegment"&lt;/SPAN&gt;
Primary_OH_path = &lt;SPAN style="color: #99cc00; border: 0px; font-weight: inherit;"&gt;r"{0}\{1}\{2}"&lt;SPAN style="color: #000000;"&gt;.format(geodatabase, dataset, feature_class)&lt;/SPAN&gt; &lt;/SPAN&gt;
Primary_OH = arcpy.MakeFeatureLayer_management(Primary_OH_path, &lt;SPAN style="color: #99cc00; border: 0px; font-weight: inherit;"&gt;"Primary_OH"&lt;/SPAN&gt;)

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:52:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750580#M57955</guid>
      <dc:creator>Javier_AntonioEscudero</dc:creator>
      <dc:date>2021-12-12T07:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750581#M57956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try testing your script using personal geodatabase for now.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But, as Michael recommends, you should evaluate to migrate your data to File Geodatabase to better support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 16:08:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750581#M57956</guid>
      <dc:creator>Javier_AntonioEscudero</dc:creator>
      <dc:date>2019-12-30T16:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750582#M57957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Javier,&lt;/P&gt;&lt;P&gt;i entered the code that you suggested:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/477176_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When running it i get the following errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/477177_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 16:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750582#M57957</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-30T16:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750583#M57958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i did put this code at the beginning&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;geodatabase = "C:\gismaps\LusData.mdb"&lt;BR /&gt;dataset = "ElectricData"&lt;BR /&gt;feature_class = "PriOHElectricLineSegment"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 16:17:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750583#M57958</guid>
      <dc:creator>RickHawkins</dc:creator>
      <dc:date>2019-12-30T16:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750584#M57959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to set another name to the layer object, like "&lt;EM&gt;Primary_OH_Layer1&lt;/EM&gt;", or something like that.&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;Primary_OH = arcpy.MakeFeatureLayer_management(Primary_OH_path, &lt;SPAN style="color: #99cc00; border: 0px; font-weight: inherit; font-size: 14px;"&gt;"Primary_OH_layer1"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2019 16:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750584#M57959</guid>
      <dc:creator>Javier_AntonioEscudero</dc:creator>
      <dc:date>2019-12-30T16:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: error: global name 'Primary_OH' is not defined</title>
      <link>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750585#M57960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;geodatabase = "C:\gismaps\LusData.mdb"
dataset = "ElectricData"
feature_class = "PriOHElectricLineSegment"

#####
geodatabase = r"C:\gismaps\LusData.mdb"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You need to be careful when setting variables that include a path.&amp;nbsp; I like to use the r (raw text): it takes care of any of the escaped slashes for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might also consider using arcpy.env.workspace; it can help clean up logical paths as well...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:52:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-global-name-primary-oh-is-not-defined/m-p/750585#M57960</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-12T07:52:39Z</dc:date>
    </item>
  </channel>
</rss>

