I am wanting to use a macro to automatically run and store image simulations using a ZPL Macro. Does anyone have example code?
Running and Saving an Image Simulation using ZPL
Best answer by David.Nguyen
Hi Karen,
It depends on what you want from that analysis window, and whether you intend to change the settings in between different uses.
If you want the result from Image Analysis as if you'd have typed a file name in the Output File settings, and if you don't mind the image being overwritten. Then, you can save your Image Analysis settings, and then simply use:
OPENANALYSISWINDOW 'sim'
Lookup the OPENANALYSISWINDOW keyword if you have relocated the setting file for Image Analysis.
If you rather want the result as if you'd have pressed the floppy icon from Image Analysis, then the keyword you need is EXPORTBMP, or EXPORTJPG and the code can be something like:
OPENANALYSISWINDOW 'sim'
# Analysis window number
sim_window = WINL()
# File path
path$ = 'E:\MYBMPFILE'
# Export window to BMP
EXPORTBMP sim_window, path$
If you need something more involved, I'd recommend using the ZOS-API for this kind of task. It'll give you more freedom to get the results that you want.
Let me know if this is clear, and take care,
David
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.