Hi, I'm new to python. I created a model using vb with model builder and it works fine. When I exported it as a python script it does not perform it's function. This is the Code: # --------------------------------------------------------------------------- # test.py # Created on: Tue Jun 21 2011 03:36:21 PM # (generated by ArcGIS/ModelBuilder) # --------------------------------------------------------------------------- # Import system modules import sys, string, os, arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() # Load required toolboxes... gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") # Local variables... parcel_shp = "C:\\PVAShp\\parcel.shp" parcel_shp__2_ = "C:\\PVAShp\\parcel.shp" # Process: Calculate Field... gp.CalculateField_management(parcel_shp__2_, "per_sqft", "newval", "VB", "if ([LV_sqft] > 0) then\\n newval = [bldgvalue] / [LV_sqft]\\nelse\\n newval = 0\\nend if") can anyone tell me what is wrong or how it should be written in python? Thanks Bob
... View more