I am working on labeling parcels with an ID number. I am trying to create sorted Ids based on their location. I have this old code from an old thread by Miles Hitchen. It worked great, but now the field calculator in step 2 will give me an error in ArcGIS 10. Is there a way to fix this, or a better way to do this process in Modelbuilder or Python?
Thanks,
Tom
Process below...
1. Create two fields in you layer, "MaxY" as Double and "Id" as Long (this one may already exist).
2. Use the field calculator with the following advanced expression to populate the "MaxY" field:
Dim dMaxY As Double
Dim pGeom As IGeometry
Set pGeom = [Shape]
dMaxY = pGeom.Envelope.YMax
' Now use dMaxY as the expression for the field
3. Copy the code below into a new module of the VBA Editor, close the editor and run the macro "CreateSortedIDs"
This will give you unique ID's starting at 0 for the northern most feature, incrementing for subsequent southerly features.