1

I have a question about sequential numbering. I found a script (i'll put it below), which allows me to make a sequential numbering based on OID and thats good. But what i need is different structure of numbering... for example, sometimes i need numbering from top to bottom of polygons line, sometimes from left to right or from bottom to top and so on. I'am using Arcgis pro (but example is made using simple arcmap)

Code block:

rec=0 
def autoIncrement(string_prefix):
 global rec
 pStart = 1 #adjust start value, if req'd 
 pInterval = 1 #adjust interval value, if req'd
 if (rec == 0): 
  rec = pStart 
 else: 
  rec = rec + pInterval 
 return string_prefix + str (rec)

.

autoIncrement("11A-5-(this number is changes sequentially"))

enter image description here

  • 1
    Welcome to Geographic Information Systems! Can you please edit your question and add more details about what your problem/question is?. What happens when you run that expression in the field calculator, etc... ? Thanks! – user2856 Jan 26 at 12:07
  • Please format your code using the { } button for readability. – Andy Jan 26 at 23:12
  • You can use arcpy, see for example: gis.stackexchange.com/questions/301725/… Just change the sort function – BERA Jan 27 at 6:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.