<?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: Still not running Please help! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21763#M1688</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I assumed RouteID was a number.&amp;nbsp; However, if the value "26.2.00" is a correct RouteID representation then it must be a string, not a number.&amp;nbsp; If that is the case the SQL where clause would be:&lt;BR /&gt;&lt;BR /&gt;arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", '"RouteID" = \'' + ThisFID + '\'"' ...&lt;BR /&gt;&lt;BR /&gt;Single quotes have to enclose the ThisFID value within the where clause string so that when it finally is translated to SQL it will appear as:&lt;BR /&gt;&lt;BR /&gt;"RouteID" = '26.2.00'&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Im confused by the syntax.&amp;nbsp; Which are single and which are double quotes and the \ is to make something "raw"?&amp;nbsp; Sorry!&amp;nbsp; I really appreciate the help.&amp;nbsp; I have borrowed from many of your posts&amp;nbsp; and absolutely appreciate you help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alicia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2013 22:44:12 GMT</pubDate>
    <dc:creator>AliciaMein</dc:creator>
    <dc:date>2013-10-17T22:44:12Z</dc:date>
    <item>
      <title>Still not running Please help!</title>
      <link>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21759#M1684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="plain" name="code"&gt;#Set environment and declare varibles # arcpy.env.overwriteOutput = True arcpy.env.workspace = "C:/CustomTools/DeerSurveyRoutes/rtsScratch.gdb"&amp;nbsp; coPath = "C:/CustomTools/DeerSurveyRoutes/RtsAnlysVectors.gdb/County" rasPath = "C:/CustomTools/DeerSurveyRoutes/RtsAnlysRasters.gdb/WVUReclass" opnFrstdRas = arcpy.Raster("C:/CustomTools/DeerSurveyRoutes/RtsAnlysRasters.gdb/WVUReclass") rasCellSz = (opnFrstdRas.meanCellHeight + opnFrstdRas.meanCellWidth) / 2 rtsPath = "C:/CustomTools/DeerSurveyRoutes/RtsAnlysVectors.gdb/SmplRts2012Edited4CountyAnalysis" #Tabulate Forested/Open for county # arcpy.CheckOutExtension("Spatial") arcpy.env.snapRaster = rasPath znFld = "CoZoneName" clsFld = "Value" outTble = "CoTbleOpenFrst"&amp;nbsp; arcpy.sa.TabulateArea(coPath,znFld,opnFrstdRas,clsFld,outTble,rasCellSz)&amp;nbsp; #Create Cursor to iterate through rts and dictionary to hold county forested/open value # updtCur = arcpy.UpdateCursor(rtsPath) row = updtCur.next()&amp;nbsp; coOFDict = dict([((r.COZONENAME, f.name),r.getValue(f.name)) for f in arcpy.ListFields(outTble) for r in arcpy.SearchCursor(outTble)])&amp;nbsp; #Loop to find buffer distance of each route that will contain the same forested percent as the county&amp;nbsp; return BuffDist # for row in updtCur: &amp;nbsp;&amp;nbsp;&amp;nbsp; buffDist = 402&amp;nbsp;&amp;nbsp; #This will be meters as all my inputs are projected to UTM &amp;nbsp;&amp;nbsp;&amp;nbsp; frstPrcnt = 0 &amp;nbsp;&amp;nbsp;&amp;nbsp; frstd = coOFDict[(row.getValue(znFld),'VALUE_2')] &amp;nbsp;&amp;nbsp;&amp;nbsp; opn = coOFDict[(row.getValue(znFld),'VALUE_1')] &amp;nbsp;&amp;nbsp;&amp;nbsp; nHbt = coOFDict[(row.getValue(znFld),'VALUE_0')] &amp;nbsp;&amp;nbsp;&amp;nbsp; lpChkVal = frstd / (frstd + opn + nHbt) &amp;nbsp;&amp;nbsp;&amp;nbsp; minLpChkVal = lpChkVal - (lpChkVal * .05) &amp;nbsp;&amp;nbsp;&amp;nbsp; maxLpChkVal = lpChkVal + (lpChkVal * .05) &amp;nbsp;&amp;nbsp;&amp;nbsp; newBuffVal = buffDist &amp;nbsp;&amp;nbsp;&amp;nbsp; x = 0&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while frstPrcnt &amp;lt; minLpChkVal or frstPrcnt &amp;gt; maxLpChkVal: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thisFID = row.getValue('RouteID') &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", ("RouteID" = thisFID) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis("selectedLine","lineBuffer",buffDist,"FULL","FLAT","ALL","RouteID") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.sa.TabulateArea("lineBuffer","RouteID",rasPath,clsFld,"BufferOFTble",rasCellSz)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtOFDict = dict([((rRt.ROUTEID, fRt.name),rRt.getValue(fRt.name)) for fRt in arcpy.ListFields("BufferOFTble") for rRt in arcpy.SearchCursor("BufferOFTable")])&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtFrstd = rtOFDict[(row.getValue('RouteID'),'VALUE_2')] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtOpn = rtOFDict[(row.getValue('RouteID'),'VALUE_1')] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtNHbt = rtOFDict[(row.getValue('RouteID'),'VALUE_0')] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frstPrcnt = rtFrstd / (rtFrstd + rtOpn + rtNHbt) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newBuffVal = buffDist &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffDist = buffDist + (x * 5 * rasCellSz) &amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue('BuffDist',newBuffVal) &amp;nbsp;&amp;nbsp;&amp;nbsp; updtCur.updateRow(row) del row, updtCur, f, r, fRt, rRt &lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting this error.&amp;nbsp; Processing seems to be stopping at the Buffer.&amp;nbsp; selectedLine is created with no data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;untime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: ERROR 999999: Error executing function. An expected Field was not found or could not be retrieved properly. An expected Field was not found or could not be retrieved properly. [SmplRts2012Edited4CountyAnalysis] An expected Field was not found or could not be retrieved properly. An expected Field was not found or could not be retrieved properly. [SmplRts2012Edited4CountyAnalysis] An expected Field was not found or could not be retrieved properly. An expected Field was not found or could not be retrieved properly. [SmplRts2012Edited4CountyAnalysis] Failed to execute (Buffer). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also moved the following code out of the while and into the for with the same results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp; thisFID = row.getValue('RouteID')&amp;nbsp; arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", ("RouteID" = thisFID)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;and changed the syntax of the where clause multiple times &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'"RouteID" = thisFID'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"[RouteID] = thisFID"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working in ArcINFO 10.0 with file geodatabase in the python window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Frustrated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alicia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:27:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21759#M1684</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2013-10-17T17:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Still not running Please help!</title>
      <link>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21760#M1685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; thisFID = row.getValue('RouteID')&lt;BR /&gt; arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", ("RouteID" = thisFID)&lt;BR /&gt;&lt;BR /&gt;and changed the syntax of the where clause multiple times &lt;BR /&gt;'"RouteID" = thisFID'&lt;BR /&gt;"[RouteID] = thisFID"&lt;BR /&gt;I am working in ArcINFO 10.0 with file geodatabase in the python window.&lt;BR /&gt;Frustrated!&lt;BR /&gt;Alicia&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The where clause has to be contained in a quoted string within the MakeFeatureLayer method.&amp;nbsp; But the ThisFID has to be translated from a number into a string before it can be appended to the where clause string.&amp;nbsp; So it needs to be written as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", '"RouteID" = ' + str(ThisFID) + '"' ...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:38:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21760#M1685</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-10-17T17:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Still not running Please help!</title>
      <link>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21761#M1686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The where clause has to be contained in a quoted string within the MakeFeatureLayer method.&amp;nbsp; But the ThisFID has to be translated from a number into a string before it can be appended to the where clause string.&amp;nbsp; So it needs to be written as:&lt;BR /&gt;&lt;BR /&gt; arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", '"RouteID" = ' + str(ThisFID) + '"' ...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Making progress but still an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Runtime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: ERROR 999999: Error executing function. An invalid SQL statement was used. An invalid SQL statement was used. [SmplRts2012Edited4CountyAnalysis] An invalid SQL statement was used. [SELECT * FROM SmplRts2012Edited4CountyAnalysis WHERE "RouteID" =26.2.00] An invalid SQL statement was used. An invalid SQL statement was used. [SmplRts2012Edited4CountyAnalysis] An invalid SQL statement was used. [SELECT * FROM SmplRts2012Edited4CountyAnalysis WHERE "RouteID" =26.2.00] An invalid SQL statement was used. An invalid SQL statement was used. [SmplRts2012Edited4CountyAnalysis] An invalid SQL statement was used. [SELECT OBJECTID FROM SmplRts2012Edited4CountyAnalysis WHERE "RouteID" =26.2.00] Failed to execute (Buffer). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to add that the selectedLine seems to be created, but empty.&amp;nbsp; Open table and it has all fields but no data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to find this lyr in catalog (both inside of ArcInfo in catalog and in ArcCatalog) and cant find it.&amp;nbsp; I thought I might need to delete it and get started clean.&amp;nbsp; The properties of the lyr says:&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File Geodatabase Feature Class &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Location: C:\CustomTools\DeerSurveyRoutes\RtsAnlysVectors.gdb&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Feature Class: SmplRts2012Edited4CountyAnalysis&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Feature Type: Simple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Geometry Type: Line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would have assumed it would be in the&amp;nbsp; "C:/CustomTools/DeerSurveyRoutes/rtsScratch.gdb" as set up in my env.workspace earlier.&amp;nbsp; In any case.&amp;nbsp; I can not find it, even after I shut everything down and bring it back up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alicia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21761#M1686</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2013-10-17T17:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Still not running Please help!</title>
      <link>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21762#M1687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Making progress but still an error:&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;Runtime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: ERROR 999999: Error executing function. An invalid SQL statement was used. An invalid SQL statement was used. [SmplRts2012Edited4CountyAnalysis] An invalid SQL statement was used. [SELECT * FROM SmplRts2012Edited4CountyAnalysis WHERE "RouteID" =26.2.00] An invalid SQL statement was used. An invalid SQL statement was used. [SmplRts2012Edited4CountyAnalysis] An invalid SQL statement was used. [SELECT * FROM SmplRts2012Edited4CountyAnalysis WHERE "RouteID" =26.2.00] An invalid SQL statement was used. An invalid SQL statement was used. [SmplRts2012Edited4CountyAnalysis] An invalid SQL statement was used. [SELECT OBJECTID FROM SmplRts2012Edited4CountyAnalysis WHERE "RouteID" =26.2.00] Failed to execute (Buffer). &lt;BR /&gt;&lt;BR /&gt;I would like to add that the selectedLine seems to be created, but empty.&amp;nbsp; Open table and it has all fields but no data.&lt;BR /&gt;&lt;BR /&gt;I tried to find this lyr in catalog (both inside of ArcInfo in catalog and in ArcCatalog) and cant find it.&amp;nbsp; I thought I might need to delete it and get started clean.&amp;nbsp; The properties of the lyr says:&amp;nbsp; &lt;BR /&gt;File Geodatabase Feature Class &lt;BR /&gt;Location: C:\CustomTools\DeerSurveyRoutes\RtsAnlysVectors.gdb&lt;BR /&gt;Feature Class: SmplRts2012Edited4CountyAnalysis&lt;BR /&gt;Feature Type: Simple&lt;BR /&gt;Geometry Type: Line&lt;BR /&gt;&lt;BR /&gt;I would have assumed it would be in the&amp;nbsp; "C:/CustomTools/DeerSurveyRoutes/rtsScratch.gdb" as set up in my env.workspace earlier.&amp;nbsp; In any case.&amp;nbsp; I can not find it, even after I shut everything down and bring it back up.&lt;BR /&gt;Thanks!&lt;BR /&gt;Alicia&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I assumed RouteID was a number.&amp;nbsp; However, if the value "26.2.00" is a correct RouteID representation then it must be a string, not a number.&amp;nbsp; If that is the case the SQL where clause would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", '"RouteID" = \'' + ThisFID + '\'"' ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Single quotes have to enclose the ThisFID value within the where clause string so that when it finally is translated to SQL it will appear as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"RouteID" = '26.2.00'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 19:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21762#M1687</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-10-17T19:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Still not running Please help!</title>
      <link>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21763#M1688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I assumed RouteID was a number.&amp;nbsp; However, if the value "26.2.00" is a correct RouteID representation then it must be a string, not a number.&amp;nbsp; If that is the case the SQL where clause would be:&lt;BR /&gt;&lt;BR /&gt;arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", '"RouteID" = \'' + ThisFID + '\'"' ...&lt;BR /&gt;&lt;BR /&gt;Single quotes have to enclose the ThisFID value within the where clause string so that when it finally is translated to SQL it will appear as:&lt;BR /&gt;&lt;BR /&gt;"RouteID" = '26.2.00'&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Im confused by the syntax.&amp;nbsp; Which are single and which are double quotes and the \ is to make something "raw"?&amp;nbsp; Sorry!&amp;nbsp; I really appreciate the help.&amp;nbsp; I have borrowed from many of your posts&amp;nbsp; and absolutely appreciate you help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alicia&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 22:44:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21763#M1688</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2013-10-17T22:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Still not running Please help!</title>
      <link>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21764#M1689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got the syntax and moved forward only to find I can not access the table while the update cursor is active.&amp;nbsp; Do I have to start over and write new code or is there another solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Runtime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: ERROR 999999: Error executing function. Cannot acquire a lock. Cannot acquire a lock. [The table SmplRts2012Edited4CountyAnalysis is being written by another process.] Cannot acquire a lock. Cannot acquire a lock. [The table SmplRts2012Edited4CountyAnalysis is being written by another process.] Cannot acquire a lock. Cannot acquire a lock. [The table SmplRts2012Edited4CountyAnalysis is being written by another process.] The table was not found. [lineBuffer] Failed to execute (Buffer). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 23:26:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21764#M1689</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2013-10-17T23:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Still not running Please help!</title>
      <link>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21765#M1690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did it!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I got it running.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#Set environment and declare varibles
#
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/CustomTools/DeerSurveyRoutes/rtsScratch.gdb"

coPath = "C:/CustomTools/DeerSurveyRoutes/RtsAnlysVectors.gdb/County"
rasPath = "C:/CustomTools/DeerSurveyRoutes/RtsAnlysRasters.gdb/WVUReclass"
opnFrstdRas = arcpy.Raster("C:/CustomTools/DeerSurveyRoutes/RtsAnlysRasters.gdb/WVUReclass")
rasCellSz = (opnFrstdRas.meanCellHeight + opnFrstdRas.meanCellWidth) / 2
rtsPath = "C:/CustomTools/DeerSurveyRoutes/RtsAnlysVectors.gdb/SmplRts2012Edited4CountyAnalysis"

#Set environemt and create variables for County area tabulation
#
arcpy.CheckOutExtension("Spatial")
arcpy.env.snapRaster = rasPath
znFld = "CoZoneName"
clsFld = "Value"
outTble = "CoTbleOpenFrst"

# Tabulate area of each class in raster and set up dictionary to hold values in table.
#
arcpy.sa.TabulateArea(coPath,znFld,opnFrstdRas,clsFld,outTble,rasCellSz)
coOFDict = dict([((r.COZONENAME, f.name),r.getValue(f.name)) for f in arcpy.ListFields(outTble) for r in arcpy.SearchCursor(outTble)])
del r, f

#Create dictionary of Rts Containing the CoZoneName, RouteID and BufferDist
rtDict = dict([((r.RouteID, f.name),r.getValue(f.name)) for f in arcpy.ListFields(rtsPath) for r in arcpy.SearchCursor(rtsPath)])
del r, f

#Loop to find buffer distance of each route that will contain the same forested percent as the county&amp;nbsp; return BuffDist
#
buffCur = arcpy.SearchCursor(rtsPath)
#row = buffCur.next()
for row in buffCur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; buffDist = 402
&amp;nbsp;&amp;nbsp;&amp;nbsp; frstPrcnt = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; frstd = coOFDict[(row.getValue(znFld),'VALUE_2')]
&amp;nbsp;&amp;nbsp;&amp;nbsp; opn = coOFDict[(row.getValue(znFld),'VALUE_1')]
&amp;nbsp;&amp;nbsp;&amp;nbsp; nHbt = coOFDict[(row.getValue(znFld),'VALUE_0')]
&amp;nbsp;&amp;nbsp;&amp;nbsp; lpChkVal = frstd / (frstd + opn + nHbt)
&amp;nbsp;&amp;nbsp;&amp;nbsp; minLpChkVal = lpChkVal - (lpChkVal * .05)
&amp;nbsp;&amp;nbsp;&amp;nbsp; maxLpChkVal = lpChkVal + (lpChkVal * .05)
&amp;nbsp;&amp;nbsp;&amp;nbsp; x = 0

&amp;nbsp;&amp;nbsp;&amp;nbsp; #Set up feature layer for Buffer analysis
&amp;nbsp;&amp;nbsp;&amp;nbsp; #thisRtID = row.getValue('RouteID')
&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.MakeFeatureLayer_management(rtsPath, "selectedLine", '"RouteID" = \'' + thisRtID + '\'')

&amp;nbsp;&amp;nbsp;&amp;nbsp; while frstPrcnt &amp;lt; minLpChkVal or frstPrcnt &amp;gt; maxLpChkVal:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis(row.shape, "lineBuffer", buffDist,"FULL","FLAT","ALL")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.sa.TabulateArea("lineBuffer","OBJECTID",rasPath,clsFld,"BufferOFTble",rasCellSz)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtOFDict = dict([((r.OBJECTID, f.name),r.getValue(f.name)) for f in arcpy.ListFields("BufferOFTble") for r in arcpy.SearchCursor("BufferOFTble")])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del r, f
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtFrstd = rtOFDict[(1,'VALUE_2')]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtOpn = rtOFDict[(1,'VALUE_1')]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtNHbt = rtOFDict[(1,'VALUE_0')]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frstPrcnt = rtFrstd / (rtFrstd + rtOpn + rtNHbt)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newBuffVal = buffDist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffDist = buffDist + (x * 5 * rasCellSz)
&amp;nbsp;&amp;nbsp;&amp;nbsp; rtDict[(row.getValue('RouteID'), 'BufferDist')] = newBuffVal 
#Create Cursor to iterate through rts and dictionary to update buffer distance.
#
updtCur = arcpy.UpdateCursor(rtsPath)

for rows in updtCur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; dist = rtDict[(rows.getValue('RouteID'), 'BufferDist')]
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.setValue('BufferDist', dist)
&amp;nbsp;&amp;nbsp;&amp;nbsp; updtCur.updateRow(rows)
del rows, updtCur, row, buffCur

&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I moved update cursor to the end.&amp;nbsp; Used my rtDict and just updated the BufferDist when is was found in the loop.&amp;nbsp; Then passed that into the update and got my values.!!!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also used row.shape as an arg in the Buffer tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:53:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/still-not-running-please-help/m-p/21765#M1690</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2021-12-10T20:53:31Z</dc:date>
    </item>
  </channel>
</rss>

