Skip to main content
Solved

How to save an image of geometric image analysis and export cross x and y data using ZPL

  • Jun 20, 2023 1:41 AM UTC
  • 1 reply
  • 353 views

yuan.chen
Zemax Staff
Forum|alt.badge.img+3

I want to save the image simulation result and the same time, I need to export the text file of cross x and cross y data. How to do it using ZPL macro

Best answer by yuan.chen

The sample macro is attached. You need to save the config file to generate the image simulation result and the cross x and cross y. 

Here are some remarks when I wrote this macro.

  1. Be careful with the path. I spent hours on the mistake ‘’ and my colleague saved my life and nearly burnt brain. The correct one is “”. 
  2. If we export multiple datasets, it’s important to add the flag 1 in GETTEXTFILE. If the flag value is 1, then the settings provided in the settings file, if valid, will be used to generate the file. This is the same if we want to generate a cross section of image simulation. The same code is : GETTEXTFILE Filename$, Sim, IS_settingsfilename$, 1
View original

1 reply

yuan.chen
Zemax Staff
Forum|alt.badge.img+3
  • Author
  • Zemax Staff
  • Answer
  • Jun 20, 2023 1:52 AM UTC

The sample macro is attached. You need to save the config file to generate the image simulation result and the cross x and cross y. 

Here are some remarks when I wrote this macro.

  1. Be careful with the path. I spent hours on the mistake ‘’ and my colleague saved my life and nearly burnt brain. The correct one is “”. 
  2. If we export multiple datasets, it’s important to add the flag 1 in GETTEXTFILE. If the flag value is 1, then the settings provided in the settings file, if valid, will be used to generate the file. This is the same if we want to generate a cross section of image simulation. The same code is : GETTEXTFILE Filename$, Sim, IS_settingsfilename$, 1