I have some address points selected for which that I want to update the address field based upon the row in the selection. How do I figure out the name of the selection taable to pass to arcpy.UpdateCursor()?
-
1Could you edit your post to explain more what you're trying to do? Also, what version of ArcMap are you using?– PaulCommented Aug 16, 2013 at 16:20
-
I am using ArcGIS 10.1. I have a selection of points that refer to the placement of buildings in a larger feature class of building points. I want to put the row number of the selected rows in the building address field. Is it possible to place the row of the selection into a field of a group of selected rows? I don't know what the name of the table is since I only want to change the building number field in a few (selected) rows of a table.– Paul KranzCommented Aug 19, 2013 at 11:35
Add a comment
|
2 Answers
If you're simply isolating selected features for use with an update cursor, it should be as simple as -
use gp.MakeFeatureLayer("featureclass", "featlyr")
cursor = gp.UpdateCursor("featlyr", "", "", "BLDADDRESS")
row = cursor.next()
while row:
rownum = row.getValue("OID_or_NUM")
row.setValue("BLDADDRESS", rownum)
cursor.updateRow(row)
row = cursor.Next()
I think you can only do that from a Python Add-In.