Ignore errors in ZPL

  • 30 October 2020
  • 1 reply
  • 137 views

Badge

Is there a way to ignore errors while running a ZPL, and keep it running?


I have a ZPL that opens files and some files come up with the following error.


 


Zemax Error Message


Cannot determine object coordinates!


OK


I select OK and the ZPL can continue running.


But since I am running through many files this comes up often and doesn't continue until I select OK.


Is there a way to ignore these errors and allow a ZPL to continue running? Without having to select OK each time?


Thank you,


 


 


1 reply

Userlevel 6
Badge +2

Hello Roger


No unfortunately there is no way to ignore the error messages in ZPL. It is quite a basic programming language. 


What you can do instead is add some error handling line in your code to avoid these error messages, so find the conditions that cause the errors. This can be done through the use of an IF statement. We have some examples of this in the Knowledgebase article “How to write a ZPL macro: Computing Zonal Transverse Chromatic Aberration.” 


Another solution would be to avoid updates, to avoid errors and only update when necessary. The keywords SUSPENDUPDATES and RESUMEUPDATES can be used for that purpose.


Let me know if that helps and do not hesitate if you have any further questions.


Sandrine

Reply