LUGDC

UpdateCursor works in Python Window, but not in toolbox or stand-alone script

Discussion created by LUGDC on Aug 28, 2012
Latest reply on Jul 3, 2013 by stacyrendall
This is a snippet of a larger script, but I can't quite get this portion to run. The ZFile and Planner variable are entered at the start in the toolbox. SaveFile is a reference to the feature class in a geodatabase that was created earlier in the script.

The "1000" gets updated no problem. If I put any other value as the updated data, it seems to work. It won't accept the value something that was entered (getparameterastext).

The entire script works perfectly if I copy and paste it into the python window (but have to set the ZFile and Planner variables in the script).

I can't figure where I'm going wrong here. If you need the larger script, let me know.

updateRows = arcpy.UpdateCursor(SaveFile)
                                
for uRow in updateRows:
    uRow.ZFile = ZFile
    updateRows.updateRow(uRow)
    uRow.Planner = Planner
    updateRows.updateRow(uRow)
    uRow.Scale = "1000"
    updateRows.updateRow(uRow)

Outcomes