1

I need to open an ArcGIS Pro project (.aprx) file in the ArcGIS Pro application inside of an arcpy script.

Does anyone know of a way to accomplish this?

I am using ArcGIS pro 2.4.1.

By open, I mean having the application actually open up on my screen. Similar to opening it from the start menu but utilizing the script instead.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Sep 26, 2019 at 19:24

3 Answers 3

3

I have done something similar to open PDF files in Adobe Acrobat Reader in the past so I just looked up this answer to Opening PDF generated by Python AddIn using Report (*.rlf) file automatcally? and tested:

import os
myfile = r"C:\Temp\Projects\TestProject\TestProject.aprx"
os.system("start " + myfile)

and it worked.

answered Sep 26, 2019 at 22:59
0
1

You can use:

aprx = arcpy.mp.ArcGISProject(r"C:\path\to\project.aprx")

For further things you can do with aprx refer to the documentation.

answered Sep 26, 2019 at 19:31
1
  • I meant open as in have it pop up, as if the icon was double clicked. Let me update the question. Commented Sep 26, 2019 at 19:50
0

you can also use subprocess to do this. In my implementation, subprocess was a better choice.

import subprocess
myfile = r"C:\Temp\Projects\TestProject\TestProject.aprx"
subprocess.Popen([myfile], shell=True)
answered Feb 29, 2024 at 19:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.