Traceback (most recent call last): File "D:\CubeAlbuquerque\AlbuquerqueNewTAZ\02_Applications\02_Transit_walk_Acc ess\ptaccess_SM.py", line 55, in <module> arcpy.CalculateField_management("TAZ_un_Buffer_Dissolve.shp", "totalArea","[ shape.area]", "VB", "") File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", li ne 3128, in CalculateField raise e arcgisscripting.ExecuteError: ERROR 999999: Error executing function. Failed to execute (CalculateField).
Solved! Go to Solution.
Yes, like i said when i used the caluclate filed python expression the script works, but it crashes when it finish working. I can open the shapefile and see all the fields and their values. Now i dont know why python crashes when i do this and i dont know how to debug something like this.
Hello Daniel,
Very tricky indeed. I couldn't see much from your screenshot (the resolution was too low), but I see how that is a hard problem to solve. If you comment out the arcpy.CalculateField_management line, does it run successfully without crashing at the end?
Can you check to see if Background Geoprocessing is enabled (default value)? If Background Geoprocessing is enabled, can you disable it and run your script with Python again.
Can you make a backup of your shapefile and then delete almost all records leaving just 2 or 3 and then run the script on that shapefile to see if it runs correctly with python?
arcpy.CalculateField_management("TAZ_un_Buffer_Dissolve.shp","TotalArea","!Shape.area!","PYTHON","#")
arcpy.CalculateField_management("TAZ_un_Buffer_Dissolve.shp","TotalArea","!Shape.area!","PYTHON")
So just to confirm,arcpy.CalculateField_management("TAZ_un_Buffer_Dissolve.shp","TotalArea","!Shape.area!","PYTHON","#")
To this:arcpy.CalculateField_management("TAZ_un_Buffer_Dissolve.shp","TotalArea","!Shape.area!","PYTHON")
arcpy.AddField_management("TAZ_un_Buffer_Dissolve.shp", "TotalArea", "DOUBLE", 10, 10)