I think this will work, but I have not tested it. Also there might be an easier way. But what I did was create a new field that combines the values from the x & y fields (you can delete this new field at the end if you want). Then search that one field for duplicates and add the values to the isDuplicate field.
You also might need to make sure when you created isDuplicate it is a FLOAT field.
Code:
ObjectLayer = "Name of Layer to be flagged"
arcpy.AddField_management(ObjectLayer,"Working","TEXT","50")
expression = "x + y"
arcpy.CalculateField_management(ObjectLayer,"Working",expression,"PYTHON")
dupField = "Working"
Duplicate = "isDuplicate"
rows = arcpy.UpdateCursor(ObjectLayer,"","","",dupField)
mylist = []
i = -1
for row in rows:
if i == -1:
value = row.getValue(dupField)
mylist.append(value)
i += 1
if row.getValue(dupField) != value:
value = row.getValue(dupField)
mylist.append(value)
i = 0
row.isDuplicate = i
rows.updateRow(row)
Bookmarks