So I'm relatively new to ArcGIS and ArcCatalog. I have created a field name of PROJECTID in a feature class in a Personal Geodatabase. The data type is TEXT. This will be a ten digit ID. The first five characters will be a acronym. The sixth character will be a digit that represents the type of feature. It will be a number. The last four characters will be numbers that should be incremented starting at 0001.
Example: WATER-1-0001
Screen shot of the field:
So my question is how can I do this in ArcCatalog. I've seen some Python code that will autoincrement like the following:
rec=[OBJECTID]
def autoIncrement(a):
global rec
return "water" + str(a) + "-" + format(rec, '04d')
Again I'm a newbie when it comes to ArcGIS . Now I am getting an error NameError name 'OBJECTID' is not defined.
No comments:
Post a Comment