Python script using mobile geoprocessing tools

338
1
09-12-2012 05:25 AM
AlanTonkin
Occasional Contributor
Hi all,

I have a Python script that I am trying to run. It calls a geoprocessing tool found in the Mobile toolbox:

arcpy.CreateMobileCache_mobile( mxdName,fldName,"#","#","#" )

When running this script, i get the following error:

'module' object has no attribute 'CreateMobileCache_mobile'

My thinking is that since ArcGIS Mobile is a separate installation to ArcGIS Desktop, Python doesn't know where to find the python script versions of the mobile geoprocessing tools. All other geoprocessing tools (those installed with ArcGIS Desktop) can be used without the above error occurring. Is there some sort of path setting that needs to have the location of the "mobile" python scripts added to it?

I found the python scripts for the mobile geoprocessing tools in "C:\Program Files (x86)\ArcGIS\Mobile3.0\arcpy\mobile". There are four files in here, namely:

__init__.py
__init__.pyc
mobile.py
mobile.pyc

Should I copy these files to the ArcGIS Desktop equivalent found at "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy"?

Please could someone more familiar with Python guide me in the right direction so that I can use these mobile geoprocessing tools in Python? Any help would be greatly appreciated.

Alan
Tags (2)
0 Kudos
1 Reply
curtvprice
MVP Esteemed Contributor
I'd try importing the toolbox into arcpy. That may be all you need to do:

arcpy.ImportToolbox("path/MobileTools.tbx")
0 Kudos