<?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: Can I use row object to select features for geoprocessing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699992#M54233</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;1) Variables are case sensitive- You have defined both a CoZoneName and a COZONENAME- Is that valid? (i.e. do you want two?)&lt;BR /&gt;2) In the loop, you refer to the name of the field (CoZoneName) rather than the variable assigned to it (znFld)- I think it should be frstd = coOPDict[(row.getValue(znFld),'VALUE_2')]&lt;BR /&gt;&lt;BR /&gt;(I'm certainly no python expert so may be way off...but it's always good to get some fresh eyes on your code!)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, this was perfect.&amp;nbsp; about the two different CoZoneName and COZONENAME, my output table comes back all caps and I can not access the zariable in the dict without using all caps, so that is why you see it that way.&amp;nbsp; Tonight I am trying to get the buffers done.&amp;nbsp; I wll let you know what works.&amp;nbsp; I was hoping not to use a layer because I dont understand the behavior that well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We will see.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Again, I really appreciate you reply.&amp;nbsp; Look to see what I figure out. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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>Tue, 15 Oct 2013 20:07:20 GMT</pubDate>
    <dc:creator>AliciaMein</dc:creator>
    <dc:date>2013-10-15T20:07:20Z</dc:date>
    <item>
      <title>Can I use row object to select features for geoprocessing</title>
      <link>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699988#M54229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is more but I know the rest is working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am wondering if I am on the right track.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I took a raster (containing values of forested, open, road, nonhabitat) and tabulated the area by county into a table (outTble).&amp;nbsp;&amp;nbsp; I want to find the buffer distance around line features (rtsPath) that has the same forested percent (frstPrcnt) as the county.&amp;nbsp; In the while loop I will increase the buffer by 5 X the cell size until the frstdPrcnt is found then I will populate the rtsPath with the approriate buffer distance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wondering about my syntax and can I use the row as input into the geoprocessing tool or am I way off?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alicia&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;rows = ap.UpdateCursor(rtsPath) for row in rows: &amp;nbsp;&amp;nbsp;&amp;nbsp; rows2 = ap.SearchCursor(outTble, '"CoZoneName" = row.CoZoneName') &amp;nbsp;&amp;nbsp;&amp;nbsp; buffDist = 402&amp;nbsp;&amp;nbsp; #This will be meters as all my inputs are UTM &amp;nbsp;&amp;nbsp;&amp;nbsp; frstdPrcnt = 0 &amp;nbsp;&amp;nbsp;&amp;nbsp; lpChkVal = (rows2[2] / (rows2[2] + rows2[3] + rows[4])) &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;&amp;nbsp; while frstdPrcnt &amp;lt; minLpChkVal or frstdPrcnt &amp;gt; maxLpChkVal: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ap.Buffer_Analysis(row,) &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Oct 2013 23:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699988#M54229</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2013-10-12T23:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use row object to select features for geoprocessing</title>
      <link>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699989#M54230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There is more but I know the rest is working.&lt;BR /&gt;I am wondering if I am on the right track.&lt;BR /&gt;&lt;BR /&gt;So I took a raster (containing values of forested, open, road, nonhabitat) and tabulated the area by county into a table (outTble).&amp;nbsp;&amp;nbsp; I want to find the buffer distance around line features (rtsPath) that has the same forested percent (frstPrcnt) as the county.&amp;nbsp; In the while loop I will increase the buffer by 5 X the cell size until the frstdPrcnt is found then I will populate the rtsPath with the approriate buffer distance.&lt;BR /&gt;&lt;BR /&gt;Wondering about my syntax and can I use the row as input into the geoprocessing tool or am I way off?&lt;BR /&gt;Thanks!&lt;BR /&gt;Alicia&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
rows = ap.UpdateCursor(rtsPath)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows2 = ap.SearchCursor(outTble, '"CoZoneName" = row.CoZoneName')
&amp;nbsp;&amp;nbsp;&amp;nbsp; buffDist = 402&amp;nbsp;&amp;nbsp; #This will be meters as all my inputs are UTM
&amp;nbsp;&amp;nbsp;&amp;nbsp; frstdPrcnt = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; lpChkVal = (rows2[2] / (rows2[2] + rows2[3] + rows[4]))
&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; while frstdPrcnt &amp;lt; minLpChkVal or frstdPrcnt &amp;gt; maxLpChkVal:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ap.Buffer_Analysis(row,) 
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My first instinct is to say 'no' as a row object isn't a feature as such.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you could do is use the attributes of the current row as a dynamic selection query in a makeFeatureLayer command and then buffer that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thisFID = row.getValue('FID')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ap.MakeFeatureLayer_management(rtsPath, "selectedLine", "[FID] = thisFID")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ap.Buffer_Analysis ("selectedLine,.....) etc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sure there is a more efficient way though!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699989#M54230</guid>
      <dc:creator>TimBarnes</dc:creator>
      <dc:date>2021-12-12T05:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use row object to select features for geoprocessing</title>
      <link>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699990#M54231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I am anxious to get there.&amp;nbsp; I have changed my code to get rid of the second cursor, couldn't figure out how to make that work and after reading decided it may have to much overhead.&amp;nbsp; I went to a dict instead of the search cursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I almost have this code working and then I will be able to try to process the routes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I now getting an error in the for loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Runtime error &amp;lt;type 'exceptions.NameError'&amp;gt;: name 'CoZoneName' is not defined&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you tell me what I am doing wrong now?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alicia&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"
... arcpy.env.cellSize = rasPath
... 
... 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
... 
... #Tabulate Forested/Open for county
... #
... arcpy.CheckOutExtension("Spatial")
... arcpy.env.snapRaster = rasPath
... znFld = "CoZoneName"
... clsFld = "Value"
... outTble = "CoTbleOpenFrst"
... 
... arcpy.sa.TabulateArea(coPath,znFld,opnFrstdRas,clsFld,outTble,rasCellSz)
... 
... #Create Cursor to iterate through rts and dictionary to hold county forested/open value
... #
... updtCur = arcpy.UpdateCursor(rtsPath)
... 
... coOPDict = dict([((r.COZONENAME, f.name),r.getValue(f.name)) for f in arcpy.ListFields(outTble) for r in arcpy.SearchCursor(outTble)])
... 
... #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;&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;&amp;nbsp; frstPrcnt = 0
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frstd = coOPDict[(row.getValue(CoZoneName),'VALUE_2')]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opn = coOPDict[(row.getValue(CoZoneName),'VALUE_1')]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nHbt = coOPDict[(row.getValue(CoZoneName),'VALUE_0')]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lpChkVal = frstd / (frstd + opn + nHbt)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minLpChkVal = lpChkVal - (lpChkVal * .05)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxLpChkVal = lpChkVal + (lpChkVal * .05)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = 0
... 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
... print frstd

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:28:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699990#M54231</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2021-12-12T05:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use row object to select features for geoprocessing</title>
      <link>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699991#M54232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1) Variables are case sensitive- You have defined both a CoZoneName and a COZONENAME- Is that valid? (i.e. do you want two?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) In the loop, you refer to the name of the field (CoZoneName) rather than the variable assigned to it (znFld)- I think it should be frstd = coOPDict[(row.getValue(znFld),'VALUE_2')]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(I'm certainly no python expert so may be way off...but it's always good to get some fresh eyes on your code!)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 19:49:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699991#M54232</guid>
      <dc:creator>TimBarnes</dc:creator>
      <dc:date>2013-10-15T19:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use row object to select features for geoprocessing</title>
      <link>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699992#M54233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;1) Variables are case sensitive- You have defined both a CoZoneName and a COZONENAME- Is that valid? (i.e. do you want two?)&lt;BR /&gt;2) In the loop, you refer to the name of the field (CoZoneName) rather than the variable assigned to it (znFld)- I think it should be frstd = coOPDict[(row.getValue(znFld),'VALUE_2')]&lt;BR /&gt;&lt;BR /&gt;(I'm certainly no python expert so may be way off...but it's always good to get some fresh eyes on your code!)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, this was perfect.&amp;nbsp; about the two different CoZoneName and COZONENAME, my output table comes back all caps and I can not access the zariable in the dict without using all caps, so that is why you see it that way.&amp;nbsp; Tonight I am trying to get the buffers done.&amp;nbsp; I wll let you know what works.&amp;nbsp; I was hoping not to use a layer because I dont understand the behavior that well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We will see.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Again, I really appreciate you reply.&amp;nbsp; Look to see what I figure out. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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>Tue, 15 Oct 2013 20:07:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699992#M54233</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2013-10-15T20:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use row object to select features for geoprocessing</title>
      <link>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699993#M54234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is how I got it to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can use the row as an argument, at least in a search cursor.&amp;nbsp; I dont think it will work in any of the others because the lock the table, feature class or whatever for use.&amp;nbsp; At least that is my take.&amp;nbsp; Please someone correct me if I am wrong!&lt;/SPAN&gt;&lt;BR /&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"&amp;nbsp; #Set environemt and create variables for County area tabulation # arcpy.CheckOutExtension("Spatial") arcpy.env.snapRaster = rasPath znFld = "CoZoneName" clsFld = "Value" outTble = "CoTbleOpenFrst"&amp;nbsp; # 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&amp;nbsp; #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&amp;nbsp; #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;&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;&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;&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;&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&amp;nbsp; #Create Cursor to iterate through rts and dictionary to update buffer distance. # updtCur = arcpy.UpdateCursor(rtsPath)&amp;nbsp; 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;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 07:08:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-use-row-object-to-select-features-for/m-p/699993#M54234</guid>
      <dc:creator>AliciaMein</dc:creator>
      <dc:date>2013-10-18T07:08:26Z</dc:date>
    </item>
  </channel>
</rss>

