ZPL Feature request

  • 14 August 2023
  • 2 replies
  • 33 views

Userlevel 7
Badge +3

Hi Zemax team,

Whenever a macro is run, the Edit/Run dialog briefly flashes on the screen:

Can that be suppressed? There’s no time to intercept any of the options. It’s just a bit annoying, and it takes longer for this to flash on the screen than for my macro to run


2 replies

Userlevel 6
Badge +2

Hey Mark,

Outside of either creating the ZPL to run as a ZPLM in the MFE or as a Macro Solve (the first option doesn’t allow you to permanently change the state of the system and the second option can be non-stable based on what you’re trying to do & it doesn’t allow outputs...neither of which are good robust solutions), you cannot suppress this dialog box.  The main reason is the ZPL code has to be run in a “locked” state, meaning the user cannot change the core system in between the start of the ZPL and the end of the ZPL.  Both the MFE and Macro Solve lock TheOpticalSystem during updates but the easiest way to ensure TheOpticalSystem is locked during the execution of a ZPL is to make the Zemax Programming Language dialog popup in a modal state.

What’s your macro?  Maybe there are other options to do what you’re trying to do.  

Userlevel 7
Badge +3

Yep, I figured it was a question of doing something the easy way.

The macro itself doesn’t matter, it just runs in less than 0.3 second and so the dialog popping up and going away again is about 3X the macro execution. I’m sure whatever it is that needs to be done can be done without using a second of user time showing a literal pop-up menu. 😁

Reply