I am trying to automate a checkout/in process with the ArcPad toolbox, having followed the instructions here to expose the tools to Python in my ArcGIS 10.1 installation. It appears to work if I use the old 9.3 arcgisscripting module to find the tools. This all works as intended (but poorly implemented IMO - what happened to consistency?).However, I want to get this working on an always-on machine (our client's server, running ArcGIS Server, ArcGIS Desktop) to enable scheduling of the script after survey data is received, but the same script does not work on that machine. I checked the ArcToolbox tool for ProcessArcPad_Project and this worked fine, though exporting it from a model to Python script gives me a script which fails. I presume that there may be something I have missed with it being Server + Desktop.Using arcpy (i.e. exported from modelbuilder):
import arcpy
mxd = 'My map.mxd'
arcpy.ImportToolbox(r'C:\Program Files (x86)\ArcGIS\ArcPad10.0\DesktopTools10\ArcPad Tools.tbx')
arcpy.ProcessArcPadProject_ArcPad(mxd, 'true')
.............................................................................
Traceback (most recent call last):
File "X:\Work\Projects\Green Areas\SURVEY\GIS\Scripts\arcpad_checkout.py", line 30, in <module>
arcpy.ProcessArcPadProject_ArcPad(mxd, 'true')
TypeError: ProcessArcPadProject() takes no arguments (2 given)
Using arcgisscripting:
import arcgisscripting
mxd = 'My map.mxd'
gp = arcgisscripting.create()
gp.ProcessArcPadProject_ArcPad(mxd, 'true')
...........................................................
Traceback (most recent call last):
File "X:\Work\Projects\Green Areas\SURVEY\GIS\Scripts\arcpad_checkout.py", line 29, in <module>
gp.ProcessArcPadProject_ArcPad(mxd, 'true')
AttributeError: Object: Tool or environment <ProcessArcPadProject_ArcPad> not found
What am I doing wrong on the server. Have I accidentally done something right on my own machine?!