I am trying to implement a Python routine to update a Map Tile Package that will be used for offline map downloads with Lattitude Geographics GeoCortex product. The code snippet below was an output from Model Builder. The model ran successfully and updated the TPK. When running in Python, the generic error code appears (which isn't helpful):
ERROR 999999: Error executing function.
Failed to execute (CreateMapTilePackage).
Looking for insight to see if anyone else has had this problem.
Some troubleshooting I have done without different results:
- Run the model from within Python calling the model from a toolbox
- Change file paths for invalid characters
- Tried another machine
I am on ArcGIS Desktop 10.3.1 on a Windows 8.1 system and Python version is 2.7.8.
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> os
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>overwriteOutput <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
<SPAN class="comment token"># Process: Create Map Tile Package</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CreateMapTilePackage_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"C:\\Path\\To\\MXDtoBeUsed.mxd"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ONLINE"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"C:\\Path\\To\\TPKtobeUsed.tpk"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"PNG"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"4"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"TPKforGMAF"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Basemap"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>