xzos/PyZDDE

zGetImageSimulation not working

andibarg opened this issue · 2 comments

'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.

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?

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.