Select to view content in your preferred language

Create Mobile Map from ArcObjects or Python

4518
21
10-06-2010 11:50 PM
AndersWallberg
Emerging Contributor
I would like to automate the Mobile map creation in ArcGIS 10 from ArcObjects or Python, but can not get any of them to work. As far as I can see there is't a GPTool available for Mobile Tools in ArcObjects or am I wrong?

When I did not find it possible to use ArcObjects for this I started to look at Python. I am new to Python so maybe I am doing some misstakes here. From the Python window in ArcMap I got this simple script to work after I disabled the Background Processing option i Geoprocessing options:
##################
import arcpy
arcpy.CreateMobileMap_mobile("c:/Temp/MyMxd.mxd", "c:/Temp", "","","","")
##################

But I cant get a similar code to work in a stand alone Python script:
##################
import arceditor
import arcpy
from arcpy import env

arcpy.SetProduct("ArcEditor")

arcpy.env.scratchWorkspace = r"C:\Documents and Settings\WMUser\My Documents\ArcGIS\Default.gdb"
arcpy.env.workspace = r"C:\Documents and Settings\WMUser\My Documents\ArcGIS\Default.gdb"

map_document = r"c:\Temp\MyMxd.mxd"
output_folder = r"c:\Temp"

arcpy.CreateMobileMap_mobile(map_document, output_folder,"#", "#", "#", "#")
##################

The script does not generate any errors and I can not se any errors in the C:\Documents and Settings\WMUser\Application Data\ESRI\Desktop10.0\ArcToolbox\History log either.

Any help would be appreciated.

Anders
21 Replies
AlanTonkin
Regular Contributor
Apparently in ArcGIS 10.1, the CreateMobileMap_mobile geoprocessing tool for use in Python has changed to CreateMobileCache_mobile with slightly different parameters.

BUT as with the old tool for 10.0 and older this geoprocessing tool when used through python still does not work!!!

I am running a 64-bit OS and when running the python script it reports "CreateMobileCache() takes no arguments (2 given)" which is rather daft as the tool when run from ArcCatalog needs at least 2 parameters (the mxd & the output folder).

ESRI, is this still a bug???
0 Kudos
nev
by
Regular Contributor
Nearly 3 years on and still not working properly.  ArcGIS10.1 Arc Mobile 3.1.0.0
CreateMobileCache tool when used in python ignores the "NO_ATTACHMENTS" and exports attachments anyway.
There is no way to tell it to not export attachments using the SynchronizeMobileCache tool.

I haven't tried in .NET, can't find any documentation/examples and as pointed out above it doesn't even appear to take the parameters for attachments.
0 Kudos