The v10 arcpy "site-package" and associated functionality is not backwards compatible. There is no "hack" as the code/functionality in arcpy simply does not exist in the v9.3 libraries. Generally however, the v9.x gp object created with these three different methods IS forward compatible:gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") #valid for v9.0, v9.1, v9.2, v9.3, and v10.0gp = arcgisscripting.create() #valid for v9.2, v9.3, and v10.0gp = arcgisscripting.create(9.3) #valid for v9.3 and v10.0
fieldInfoList = [["FIELD1", "LONG"],["FIELD2", "TEXT", "30"],["FIELD3", "DOUBLE"]] for fieldInfo in fieldInfoList: if fieldInfo[1] in ("LONG","SHORT","DOUBLE","FLOAT"): gp.AddField_management (layer, fieldInfo[0], fieldInfo[1]) elif fieldInfo[1] == "TEXT": gp.AddField_management (layer, fieldInfo[0], fieldInfo[1], "", "", fieldInfo[2]) else: print "Uh oh!"
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.