Forum

Author Topic: PhotoScan.app.document not working in 1.2.2  (Read 3874 times)

eberkund

  • Newbie
  • *
  • Posts: 9
    • View Profile
PhotoScan.app.document not working in 1.2.2
« on: January 14, 2016, 07:01:04 PM »
A lot of examples in the API documentation include examples that start with this code

Code: [Select]
import PhotoScan

doc = PhotoScan.app.document

However in version 1.2.2 this is not working for me, the result in doc is empty and I cannot invoke any methods on it. I get the error:

Code: [Select]
2016-01-14 10:56:50 AttributeError: 'NoneType' object has no attribute 'save'
However, if I enter the command directly into the console it works.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: PhotoScan.app.document not working in 1.2.2
« Reply #1 on: January 14, 2016, 07:08:43 PM »
Hello e.berkun-drevnig,

Are you executing scripts using Run Script command or the script is put to the autorun folder?
Best regards,
Alexey Pasumansky,
Agisoft LLC

eberkund

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: PhotoScan.app.document not working in 1.2.2
« Reply #2 on: January 14, 2016, 09:36:37 PM »
Hi, thanks for the quick reply.

I am using the autorun folder

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: PhotoScan.app.document not working in 1.2.2
« Reply #3 on: January 14, 2016, 10:10:37 PM »
Hello e.berkun-drevnig,
 
Access to PhotoScan.app.document is blocked for scripts put in autostart folder.
So to start processing script it is necessary to run it from GUI via Run Script dialog or from custom menu item created using autorun scripts.
Best regards,
Alexey Pasumansky,
Agisoft LLC

eberkund

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: PhotoScan.app.document not working in 1.2.2
« Reply #4 on: January 14, 2016, 11:15:11 PM »
Thanks, that was very useful info