Hi Dan,
Could you look over my python script? I am having trouble for the continuation of the sequential order for a particular tile in the grid portion. I don't know what I should have for my "ID" variable.
#Setting Parameters for tool
inputLayer = arcpy.GetParameter(0) #Input layer
idField = arcpy.GetParameter(1) #Facility ID Field
i = arcpy.GetParameter(2) # Feature Class Code
grid = r"R:\GISPROJECTS\Dept_WaterUtilities\Tools\OceansideToolbar\Shapefiles\Grids.shp"
arcpy.MakeFeatureLayer_management(grid, 'grid_lyr')
grid_lyr = 'grid_lyr'
field_names = arcpy.UpdateCursor(grid_lyr)
cursor = arcpy.UpdateCursor(inputLayer)
arcpy.AddMessage("Generating ID's...\n")
for row in cursor:
#Select by NULL attribute
arcpy.SelectLayerByAttribute_management(inputLayer, 'NEW_SELECTION', '"FACILITYID" is NULL')
for field in field_names:
C = field.getValue('COL')
R = field.getValue('ROW')
Fc = str(i).zfill(2)
Col = str(C).zfill(2)
Row = str(R).zfill(2)
Fno = str(ID).zfill(3)
Code = Fc + Col + Row + Fno
row.setValue(idField, Code)
cursor.updateRow(row)
ID += 1
arcpy.Delete_management('grid_lyr')
arcpy.AddMessage("\n\nFinished...")
arcpy.AddMessage("Last ID created: " + Code)