Hello, I would like to use a macro to save images from Geometric Bitmap Image Analysis for different configuration.
I wrote this macro in ZPL to save the images obtained for different configurations but it doesn’t work:
! Read the # of configs
NCONFIG = NCON()
!Read path
settingfiles$ = "...\Zemax\Configs\IMB.CFG"
! Execute for each config
FOR i, 1, NCONFIG, 1
! Set config
SETCONFIG i
img_file$ = $STR(i) + ".png"
MODIFYSETTINGS settingfiles$, GBM_OUTPUT, img_file$
OPENANALYSISWINDOW "IBM"
PAUSE THREADS
NEXT
PRINT "DONE!"
The configuration changes and the Geometric Bitmap Image Analysis window opens up and displays the right image but nothing is saved. Moreover, the output file name keeps the initial name and it isn’t modifying for each configuration. Do you have any idea to save those images ? (the folder path doesn’t matter)
I also wrote another ZPL macro which works and saves the image of the opened window following the different configuration but it still not really what I want since it’s not just the image itself that is saved.
Here the other macro:
! Read the # of configs
NCONFIG = NCON()
! Execute for each config
FOR i, 1, NCONFIG, 1
! Set config
SETCONFIG i
OPENANALYSISWINDOW "IBM"
window = WINL()
PAUSE THREADS
img_path$ = “...”
filename$ = img_path$ + "\Red" + $STR(i)
EXPORTBMP window, filename$
NEXT
PRINT "DONE!"
Thank you in advance,