ZOS API (MATLAB)

  • 16 June 2020
  • 1 reply
  • 93 views

I have been trying to retrieve data from Zemax's FootPrint Diagram under  'Rays and Spots’ for various fields into MATLAB. From my reading and searching the help documentation I was able to located the enum ZOSAPI.Analysis.AnalysisIDM.FootprintSettings that may be helpful for the data import I need. Is there an example or help on how to exactly get the FootPrint Diagram data for various fields at different surfaces of the optical model.


1 reply

Userlevel 4
Badge +1

There is not a direct way to do this in Matlab. The Footprint Diagram does not have header data or a data series. You can, however, parse the text file, and you have two options.


You can use the GetTextFile property to obtain the text output in a temporary location and then use Matlab read and write functions to get the data.


You can also use a ZPL macro to do the same thing. This one has the advantage that one of my colleagues here at Zemax has already written one for public use in the forums. You can find it here: https://my.zemax.com/en-US/forum/threads/723c2a92-58a0-ea11-a812-000d3a329613#3bb63c93-58a0-ea11-8b72-00155d46a79c.

Reply