0

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()?

2
  • 1
    Could you edit your post to explain more what you're trying to do? Also, what version of ArcMap are you using?
    – Paul
    Commented 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 Kranz
    Commented Aug 19, 2013 at 11:35

2 Answers 2

0

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()
0

I think you can only do that from a Python Add-In.

pythonaddin.GetSelectedTOCLayerOrDataFrame()

Not the answer you're looking for? Browse other questions tagged or ask your own question.