I am writing a script and a portion of said script requires that I build a table that starts at 0 and increments by 1 until reaching the value of "Shape_Length" from a feature class. I have line work that I wish to read the "Shape_Length" from and I am having troubles getting the syntax correct.
Route = arcpy.CreateRoutes_lr(Input_Linework, Linework_Field, Output_Name)
# Store value in SHAPE_LENGTH from Route
with arcpy.da.SearchCursor(Route, ['Shape_Length']) as cursor:
for row in Cursor:
Max_Value = row.getValue('Shape_Length')
# Create table with two fields, RouteID and Chainage
Route_Table = arcpy.CreateTable_management(str(Output_WS), Output_Name))
# Append additional rows to table in increments of 1 and end at the exact value of
# the Max_Value
fields = ['RouteID', 'Chainage']
Pop_Table = arcpy.da.InsertCursor(Route_Table, fields)
for x in range(0, Max_Value):
I get an error on line 6:
AttributeError: 'tuple' object has no attribute 'getValue'
I have tried reading through the page:
I messed around with the code a bit but this is where I am at now and can't determine how to move forward.