AnsweredAssumed Answered

Create Runtime Content tool in Python script

Question asked by Jana.Pfefferova on Nov 11, 2015
Latest reply on Nov 30, 2015 by Jana.Pfefferova

Hi,

 

I need to automate the process of creating runtime geodatabase. I have a working model which use the Create Runtime Content tool. It works without any errors.

I exported this model to python script and it failed to execute.

So I tried to run that model from toolbox by using arcpy.ImportToolbox and it still wouldn't execute.

If I just copy this line arcpy.CreateRuntimeContent_management("C:\\Jana\\final.mxd", "C:\\Jana\\MobileData", "", "", "DEFAULT", "FEATURE_AND_TABULAR_DATA", "NON_OPTIMIZE_SIZE", "ONLINE", "PNG", "1", "") into python window in ArcCatalog it worked fine without any errors.

 

This is my stand-alone script for running the model:

 

import arcpy

 

arcpy.ImportToolbox("C:\Jana\Jana.tbx")

try:

    arcpy.Jana.Content()

except arcpy.ExecuteError:

    print(arcpy.GetMessages(2))

 

My toolbox alias is "Jana" and model name (as well as label) is "Content". I have also try to use arcpy.Content_Jana with the same "Failed to execute".

 

Any thoughts?

 

Thanks!

Outcomes