xzos / PyZDDE

Zemax/ OpticStudio Extension using Python
MIT License
159 stars 67 forks source link

zGetImageSimulation not working #100

Open andibarg opened 4 years ago

andibarg commented 4 years ago

'zGetImageSimulation' calls the method 'zGetTextFile' which always returns -1 and thus fails. This is not because of a timeout but simply because image simulation (at least in the latest versions of OpticStudio) does not support text output. How could this be fixed?

An ugly workaround is to specify an output file in image simulation and use 'ln.zPushLens(1)' to update it. Once this is done, one can retrieve the image file from the 'Zemax\IMAFiles' folder.

indranilsinharoy commented 4 years ago

Hi @andibarg , Can you please take a look at the "NOTE" section of the example notebook Acquisition and analysis of Image Simulation data from Zemax and see if the suggestions there help?

andibarg commented 4 years ago

Hi @indranilsinharoy,

Thanks for your reply. Unfortunately, the suggestions in the "NOTE" section do not help. I tried with short file names and without commas. Finally, I went through example 1 and got the error again at line 12, as expected: img_info, img_data = ln.zGetImageSimulation(settingsFile=cfgfile) Btw, I am using OpticStudio 19.8.