basblitz.blogg.se

Arcgisscripting python module
Arcgisscripting python module













arcgisscripting python module arcgisscripting python module

The result object’s getOutput method returns values as a unicode string. >result = arcpy.GetCount_management("myLayer") A print statement will display the string representation of the output. Now, many geoprocessing tools return a result object of the derived output dataset. At that point they became a little more tricky.

arcgisscripting python module

Results were pretty straightforward up until ArcMap 9.3. Now that I’ve been working with arcpy a bit I find my eye is trained, however in the beginning this was a common bug to find in my scripts and repair.Ĥ. And note the capital “Exists” in the example above. gp.addmessage worked before but now it has to be arcpy.AddMessage. Now it has to be exact and this can be a real pain to find all the mismatched cases. Previous versions of arcgisscripting allowed for sloppy capitalization. I do this with a find/replace command in my code editor. No need to specify any toolboxes in v10!Ģ. In other words, remove this: import arcgisscriptingĪlso in this step I remove any add toolboxes statements that I might have included. Replace the import statement and remove the geoprocessing creation statement. I developed a checklist to help me remember where to look for switching things up and thought I’d share it with others that might have the same task ahead of them. And they are still useful scripts, so I have spent some time upgrading them to the new ArcPy site-package for ArcMap version 10. They all start out with the import arcgisscripting command and are full of gp statements. Over the years I have had amassed a collection of python scripts written in previous versions of ArcMap.















Arcgisscripting python module