Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Recently I have been making scripts to run geoprocessing tools for a client who is running ArcGIS 9.3. However I only have access to ArcGIS 10.1. As a result I cannot use model builder in 10.1, and have to script everything with arcgisscripting (import arcgisscripting). I cannot find many arcgisscripting examples beyond the 9.3 help files.

My questions are: is there a way to reverse convert 10.1 (arcpy/modelbuilder) scripts to 9.3? Is there a place with good arcgisscripting .py examples? Has anyone else done this?

share|improve this question
add comment

3 Answers 3

Unless you are using geoprocessing tools that are exclusive to 10.1, you should be able to convert it backwards. First export your model to python from model builder. then change

import arcpy

to

import arcgisscripting

next set a variable to the arcgisscripting module you imported

gp = arcgisscripting.create()

after that you need to import your gp toolboxes

gp.AddToolbox("C:/Program Files (x86)/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")

after that do a find/replace and change arcpy to gp

arcpy.Intersect_analysis()

to

gp.Intersect_analysis()

i converted a bunch of 9.3 scripts to 10 using the reverse of this method and did not have any issues

share|improve this answer
add comment

As @Zachary mentioned, the key is:

  1. using tools that are available in both 10.1 and 9.3 at the same license level (don't forget that some tools changed license from 9.3 to 10.1)
  2. change "import arcpy" to "import arcgisscripting"

If you really wanted to be sneaky, though, instead of creating a new variable called gp, from: gp = arcgisscripting.create() and then having to find/replace arcpy to gp, I THINK you should be able to simply set your new variable with the name arcpy = arcgisscripting.create(), and the rest of the tool references should just work.

share|improve this answer
    
I believe you are correct about the variable name. That would be a quick, efficient way to update the script. –  Zachary Feb 6 '13 at 12:05
add comment

arcgisscripting (ArcGIS 9 Python) isn't as full featured as arcpy (ArcGIS 10 Python) This forum has a lot of discussion of both ArcGIS Python modules

http://forums.arcgis.com/forums/117-Python

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.