ZOS-API & Excel interactive extension example- retrieve incident angles on surfaces across pupil

  • 24 September 2020
  • 2 replies
  • 588 views

Userlevel 4
Badge +2
  1. Set customize ribbon (File>Options) to enable Developer tab in Excel
  2. Open VBA through Developer> Visual Basic
  3. It is required to load the ZOS-API assembly at the beginning. The macros can be checked from VBAProject> Modules 

200924-161211-image.png200924-165057-image.png

 

  1. Open the linked Excel file (with macro included), the Connect button and Surface Data button are linked to different macros.  

 200924-163104-image.png

  1. Click Interactive Extension, then the connect button. A message box will pop up and show the connected message. 

 

200924-163748-image.png

 

7. Click Surface Data button, LDE and FDE data of the current active lens file will be extracted 

200924-164042-image.png

8. Click any surface button from the generated surface button list, incident angles of rays on the target surface that tracing across the whole pupil from specific field will be retrieved and displayed on a newly opened sheet.  

 

200924-164644-image.png

 

Find the files here on the Code Exchange here: ZPL Macro: Read optimization operand across pupil | Zemax Community

 

 


2 replies

Userlevel 7
Badge +3

Wow, that's really helpful. Thank you!


- Mark

Badge

Great, VBA is widly used. This will increase acceptance of ZOS-API.

Gladly more of this!

Hans-Jürgen

 

Reply