Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: spatialdigger on July 28, 2021, 03:00:05 AM

Title: launch Metashape gui from python
Post by: spatialdigger on July 28, 2021, 03:00:05 AM
I know you can open a Metashape document into python: doc.open(filepath, read_only=False)

What  I would like to do is launch the program from within python so the user can troubleshoot any identified issues, caught in the script.

For instance if there is an exception the Metashape doc is opened in Metashape for the user to look and apply a manual fix.

I have Metashape pro.
Title: Re: launch Metashape gui from python
Post by: spatialdigger on July 28, 2021, 08:09:43 PM
With more research I see that this will be better achieved outside of metashape and purely in python
Title: Re: launch Metashape gui from python
Post by: Alexey Pasumansky on July 29, 2021, 05:31:12 PM
Hello spatialdigger,

I think you can do that using os.system command or subprocess module. Basically you need to use shell command that calls metashape executable with the path to the problematic project as an argument.