Reference .mxd parameter in ArcGIS Pro's modelbuilder?

1435
3
08-08-2016 06:51 AM
JohnSolly1
New Contributor II

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?

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

Things are a bit different in PRO... did you read these sections?

Migrating from arcpy.mapping to ArcGIS Pro—ArcPy | ArcGIS for Desktop

Guidelines for arcpy.mp—ArcPy | ArcGIS for Desktop

You are going to have to work with the new project format ... aka... *.aprx

Cross-pollination isn't going to work... you are going to have to get the project into a pro format

DanPatterson_Retired
MVP Emeritus
JohnSolly1
New Contributor II

Gotcha. Thanks!

0 Kudos