I'm attempting to write a script that will add an incremented value to a field based on a selection of records.
For example, the script will select the first 300 records in a feature class and then using calculate field assign a value of 1 to a field called "Week_Assignment". It will then select the next 300 records and assign a value of 2 to the same field, etc.
I'm able to select the records, but not able to calculate the field with an incremented value. I found some generic code on an Esri help forum that will auto increment every row in a field, but I need to modify it to add the same value to all rows in a selection.
Here's the sample code:
rec=0 def autoIncrement(): global rec pStart = 1 pInterval = 1 if (rec == 0): rec = pStart else: rec += pInterval return rec autoIncrement()