I am trying to save the following python script as a tool to be incorporated into modelbuilder within Pro:
mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
arcpy.mapping.ExportToPNG(mxd, r"C:\Project\Output\Project.png")
It works in ArcMap but I'm not sure how to do it in Pro since it does not use .mxd files.
How can I access the map document in Pro and run a tool that traditionally uses an .mxd?
Hi John,
ArcGIS Pro works with projects (.aprx). You can import your current MXD to a blank aprx. Ex:
aprx = arcpy.mp.ArcGISProject(r"C:\Projects\blank.aprx") aprx.importDocument(r"C:\Projects\YosemiteNP\Documents\Yosemite.mxd")
You can then export the layout to PNG:
Jake, for some reason I'm getting an error on you link.
thus might be what you were going for Export a map or layout—ArcGIS Pro | ArcGIS for Desktop
Thanks, Rebecca. I went ahead and added it manually.
apparently linked to modelbuilder too Reference .mxd parameter in ArcGIS Pro's modelbuilder?