Thank you! It seems like the script is running better now. However, I still come back to my first error. ERROR 00728: Field Update does not exist within table... I am not sure why because the two lines before calculating the field were specifically written to create this field...
WARNING 000304: Renamed field Update to Update_ Adding Update_ to sampcells_RotateFeatures...
Can you point me the ESRI web help for the field calculator used in python script.For instance, I never saw this in any help document before: Expression = "'{0}'".format(arcpy.GetParameterAsText(3))
Thanks!!! It works like a charm now!Just for future reference, can you point me the ESRI web help for the field calculator used in python script.For instance, I never saw this in any help document before:
"'{0}'".format(arcpy.GetParameterAsText(3))
Thanks again
I think your Expression variable should actually be:Expression = '"Update" = ' + "'" + arcpy.GetParameter(3) + "'"
Expression = '"Update" = ' + "'" + arcpy.GetParameter(3) + "'"
The error is: "cannot concatenate 'str' and 'geoprocessing value object' objects".
# Add Field arcpy.AddMessage("Adding Updated Field...") arcpy.AddField_management(Selected_cnddb_point, UpdatedField, "TEXT", "", "", "50","", "NULLABLE") #Calculate Field arcpy.AddMessage("Calculating Updated Field...") Expression = "'{0}'".format(arcpy.GetParameterAsText(3)) # single quoted string literal arcpy.CalculateField_management(Selected_cnddb_point, UpdatedField, Expression, "PYTHON")
UpdatedField = "Update" Expression = (" = " + "'" + arcpy.GetParameter(3) + "'") arcpy.CalculateField_management(Selected_cnddb_point, UpdatedField, Expression, "PYTHON")
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.