Skip to main content

Hello,

The following  ZPL-macro is run which performs a geometric analysis and then saves the text of this window:

 

OPENANALYSISWINDOW IMA, GIA_cfg_file$

n_GIA_window = WINL()

SAVEWINDOW n_GIA_window, A$

 

The size of the image is 125 pixels, resulting in a text file size of 400 KB

What I observed is that the time it takes to execute the SAVEWINDOW function takes a very long time of about 20 seconds (!), regardless of whether the text file is a temporary or permanent file.

The saving takes nearly as long as the execution of the image analysis.

However, if the text output of the very same “Geometric Image Analysis” window is saved manually to the very same file A$, the saving is performed in no time.

The subsequent extracting of specific strings from this text file by using OPEN, READSKIP and READSTRING  is also  executed within “no” time.

 

So my question is:

why is SAVEWINDOW so slow or more importantly: how can I significantly speed up the saving process?

Best regards, 

Marcel

 

Zemax-Version:  Ansys Zemax OpticStudio 2022 R2.02

 

@MRudolf 

 

I tried your macro snippet on the Double Gauss sample file. It wrote a 3.8MB file nearly instantly. I have a relatively good computer but to think it could take 20 seconds, there must be something else to it.

Are you able to share your file and full macro? Do you notice if there are other things in your UI that get updated that could slow everything down?

Take care,

 

David


Reply