Hi everyone,i want to assign a variable , a string, to a field. Therefore i have created with python a field and want now assigning a value to this field, But i get only this failure message back.<class 'arcgisscripting.ExecuteError'>: ERROR 000539: Error running expression: name2 <type 'exceptions.NameError'>: name 'name2' is not definedFailed to execute (CalculateField).The python code is listed above. for raster in rasterlist: name = str(raster) + "_WGS84" name2 = str(raster) + "test" gp.MosaicToNewRaster_management (raster, OutputLocation, name, coordinatesystem, pixeltype, cellsize, bandnumber, "", "") pathvar1 = OutputLocation + "\\" + name gp.AddField_management (pathvar1, "Name", "TEXT") gp.CalculateField_management (pathvar1, "Name", 'name2' , "PYTHON")Holm
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.