Forum

Author Topic: Proper method to close project via python API  (Read 152 times)

ashalota

  • Jr. Member
  • **
  • Posts: 86
  • Forest orthomosaics, long transects (300m agl)
    • View Profile
    • NASA: G-LiHT (Public orthomosaics)
Proper method to close project via python API
« on: January 11, 2021, 05:49:19 PM »
I've noticed I end up with a 'read-only' lock on my projects some times after I have made adjustments through my python script.

What is the correct way to close the document so it goes away when I am done working on it in python? I don't see a "close" method anywhere in the API. My best guess is to just open a blank Metashape project when I am done with my current project?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12308
    • View Profile
Re: Proper method to close project via python API
« Reply #1 on: January 13, 2021, 09:02:50 PM »
Hello ashalota,

Can you please describe the common workflow that you are using, when the "read-only" lock appears? Do you perform multiple operations with the projects using scripting in the same Metashape instance?
Best regards,
Alexey Pasumansky,
Agisoft LLC

ashalota

  • Jr. Member
  • **
  • Posts: 86
  • Forest orthomosaics, long transects (300m agl)
    • View Profile
    • NASA: G-LiHT (Public orthomosaics)
Re: Proper method to close project via python API
« Reply #2 on: January 13, 2021, 09:38:31 PM »
I believe I may have solved this issue by running "Metashape.Document()" when I am done with my process.

The issue occurred because I had been opening a project, working on it, and then transferring it to another computer. The other computer then never received any information that I ultimately closed the project. I am now making sure to "close" the project within my script by running Metashape.Document() before sending it to the other computer.