This one was bugging me in the past. When you use python and script some geoprocessing tools after one another ArcGIS makes a total mess of your object id fieldname. it can be:
Or when the user decides that the temp directory should contain shapefiles, it can be any variation of this starting with FID.
The following principle works for any arcgis version as far as I know, except that the example here is only for arcgis 10+
Here is a piece of code that simply copies the object id contents to a different fieldname (which already exists in this case):
desc = arcpy.Describe(fc) cursor = arcpy.UpdateCursor(fc) row = cursor.next() while row: ident = row.getValue(desc.OIDFieldName) row.setValue(fieldname, ident) cursor.updateRow(row) row = cursor.next()