Select to view content in your preferred language

Any script to assign sequential numbers to the parcels??

4240
7
09-08-2014 11:18 PM
SunilChandekar
Deactivated User

Hi Guys: I am new to geonet group and looking for a solution for my query.

I have hundreds of set of parcels with hundreds of count in every set. I am trying to assign a sequence number to the parcels by display order (Top left to bottom then bottom right to top)and sequence number is of 3 digits (for example 001, 002, 003... 011, 012....111, 112) with the interval of 1.

 

I need the output like attached JPG.

 

Please suggest..

 

Thanks,

Sunil

0 Kudos
7 Replies
DanPatterson_Retired
MVP Emeritus

No image...a sample script to demonstrate the principles

Field Calculation

Set the parser to "python"

use this in the field calculator...assuming you are using the FID field for the source of the calculation numbers

"%03i" % (!FID!)

will produce 000,001,002,002 etc

if you want to go to 1000 change 03 to 04 to 10,000 ... 03 to 05

etc etc...you catch the script

A demo in python,

'''

PaddingDemo.py

'''

vals = 10

print "padding strings with 0's"

for i in range(vals):

  out = "%03i" %

  print str(out)

0 Kudos
SunilChandekar
Deactivated User

Thanks for your response Dan, but it was not helping.

I am not using FID for calculating the values. FID is different some times than the sequence order i want, i need output in following way.

These numbers are given manually.

ParcelNumbers.jpg

and input right now i have is like following image,

ParcelTable.jpg

TestAlloca field i am looking to fill with sequence numbers that too in 3 digits as first image. Only location and draw order could be the source here...

plz check if possible

Thanks,

Sunil

0 Kudos
DanPatterson_Retired
MVP Emeritus

I can't think of any way to sort the data in the manner you want.  if they were drawn in sequential order, then your problem is simple.  You can't sort by geometry using a simple sort or even a radial sort.  There could be any number of ways in which those polygons could have been created.  Do you have a rule set on how you construct the shapes?

0 Kudos
Mohamed_MagdyMohamed_Hussain
Deactivated User

First you need to convert these Polygon Feature Classe to Fabric Parcels then from Parcel Editor toolbar use Name Parcels tool to Assigning sequential parcel names

Help Link: ArcGIS Help 10.1

SunilChandekar
Deactivated User

Thanks Mohamed Magdy Mohamed Hussain

Using Fabric it worked, but giving numbers/Name in Fabric is not taking it in 3 digits in a manner of 001, 002, 003...011, 012. It is taking always from 1, 2, 3. This can be done by editing in exl and updating fields. But is there a way here itself..?

Dan i tried your script but it didnt worked...any way  thank you for the efforts.

Thank's,

Sunil

0 Kudos
Mohamed_MagdyMohamed_Hussain
Deactivated User

You can change the format of the numbers in Attribute table of the feature by open field properties then in number format click [...] button then choose "Custom" in format string put "000" that make the number in 3 digits

Capture.JPG

SunilChandekar
Deactivated User

It worked... thanks a lot Mohamed...

0 Kudos