I recently started using arcpy to handle batch tasks for arcgis. I am trying to run the arcpy packagemap_management tool to batch export a bunch of mxds inside a folder.
The input layer must have a description in order for the tool to execute. To add a description, right-click the layer, click Properties, and enter a description
Good to hear from you!
Can you please elaborate your suggestion? If you meant to check the map_management help topic, I already did that. And I didnt find any option/parameter for defining the map description via python code.
Basically I am trying to set the below fields via command line during mpk creation:
in the link on layers, under properties
(Read and Write)
Provides the ability to either get or set the layer's description information. Not all layers support the description property (for example, topology layers), so it is good practice to test for this ahead of time using the supports method.
Which means you can get and/or set it with arcpy
To clarify.... the layers need to have their description set in order for them to be packaged... at least that is my reading of the packagemap help and the layer help
This description seems to be for individual layers. I am looking for "Map Package" property: Description field.
Please have a look at the screenshot I shared in my earlier comment.
MapDocument—Help | ArcGIS Desktop I guess I am reading the error wrong then, since the error noted in step 6
Creating a map package—Help | ArcGIS Desktop had to do with the unresolved mapdocument not having the correct requirements, which can be set at the mapdocument level.
The package map code script which you posted doesn't even show the need to provide a map package description.
I am also assuming that you code example just lacks proper indentation because of not using the syntax highlighter. You might want to check that the arcpy.env.workspace path should be set to a raw format string ( ie r"c:\somefolder") but I doubt that these would have thrown that error.
I you get this issue straightened out, please post back
I am able to perform a simple "print" statement for all the mxd inside that folder and getting desired results. So I am sure it is not an python indentation problem. the piece of code is able to read through the contents inside the folder and not throwing any error.
The issue is tied to the mandatory requirement for "package map" description field. But there is no parameter associated with arcpy packagemap_management which I can fill through command line.
The error clearly shows that the description is necessary ,but it does not support pushing that value through the above code.
Runtime error Traceback (most recent call last): File "<string>", line 9, in <module> File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 8197, in PackageMap raise e ExecuteError: #ERROR 001117: Map description property must be set Failed to execute (PackageMap).
Now since I want to iterate the job for all the mxds inside the folder, how do I bypass that requirement. Or rather set it via arcpy using the above code for all the mxds.