Update ZPL Windows

  • 27 September 2019
  • 2 replies
  • 137 views

Good afternoon,



I have a ZPL macro which performs a couple of very quick calculations.  Ideally I'd like to have the macro update automatically when I edit the lens data, the way other windows do.  I don't care if it's in the text viewer, graphic viewer, or some as-yet-undiscovered ouptut. But at the moment I can't find any way to have my macro re-run on changes except by clicking the "Update" arrows on the Text Viewer window directly



I can see why Zemax might want to avoid this, as it could quickly create a never-ending loop if the macro itself makes any changes.  However: there is a tick box called "Update ZLP Windows" in the Visual Optimizer  that gives me some hope that this is possible.  However, checking/unchecking that box doesn't seem to have any impact, and I can't find any reference to it in the documentation.  Evidently it's a new option, as it's not shown the screen capture of the window in the help file.



Does anyone have any information on the intended behaviour/purpose of the "Update ZPL Windows" checkbox? Or does anyone know of any hooks I can put in my macro which will trigger it to update, either from a change of the visual optimizer or from a change in the lens data directly?



Evidently I can achieve this through a User Analysis ZOS-API, but that will take some extra time for me to understand.  If there's a quicker way to achieve it with ZPL, I'd love to know about it.



Thanks for your help.



Pete

2 replies

Userlevel 4
Badge +3
Hi Pete!



You're right, it looks like we need to update our Help file to discuss the "Update ZPL Windows" option. I'll get on that, but will have to do some investigation to see what that's supposed to do.



I don't know of any hooks that you can put into your macro to make it update automatically when something in your LDE is changed, but if your macro is just performing a few simple calculations, you could turn it into a ZPLM operand or two in your merit function editor, and your merit function can update automatically (including re-calculating the ZPLM operand) when your LDE is edited.



Here's a KBA all about using a ZPLM operand. https://my.zemax.com/en-US/Knowledge-Base/kb-article/?ka=KA-01574



Let me know if this works for you!



Alissa
Alissa,



Thansk for that.   Making my macro an operand and using the Merit Function Editor to display the result will do the trick.  



I'd be curious to know about "Update ZPL Windows" some day, but this means I can keep going without it.



Thanks for your help,



PS

Reply