2

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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Feb 5, 2013 at 18:42

3 Answers 3

4

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

answered Feb 5, 2013 at 18:53
4

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.

answered Feb 5, 2013 at 22:43
1
  • I believe you are correct about the variable name. That would be a quick, efficient way to update the script. Commented Feb 6, 2013 at 12:05
0

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

answered Feb 5, 2013 at 19:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.