Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: Dud3r on November 24, 2017, 06:33:12 PM
-
Hi,
I'm trying to verify, that my already created Photoscan project has been opened properly:
import PhotoScan as ps
pf_proj = '/path/to/my/existing/document.psz'
doc = ps.Document()
if not doc.open(pf_proj):
print("ERROR: Could not open document: " + pf_proj)
I always get "ERROR: Cold not open document:", although the document seems opened properly.
Is there another way to check if the document is loaded correctly?
-
Hello Dud3r,
In PhotoScan 1.3 doc.open() function is not returning anything, like status of the operation success, so I can suggest to use try-except approach:
try:
doc.open(path)
except:
print("ERROR")
-
Thank you Alexey. That is basic Python. Should have thought of this.