Skip to content

Instantly share code, notes, and snippets.

@antoniolocandro
Created December 12, 2013 17:12
Show Gist options
  • Save antoniolocandro/7931540 to your computer and use it in GitHub Desktop.
Save antoniolocandro/7931540 to your computer and use it in GitHub Desktop.
Arcgis Python Codeblock / add autoIncrement() to Expression. Modified from http://forums.arcgis.com/threads/40981-Adding-to-fields-by-increments-of-1-in-the-Field-Calculator
rec=0
def autoIncrement():
global rec
pStart = 0 #adjust start value, if req'd
pInterval = 50 #adjust interval value, if req'd
if (rec == 0):
rec = pStart
else:
rec = rec + pInterval
return rec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment