When using a ZPL macro, is there the possibility of using a keyword that function like quickadjust?
There is the keyword QUICKFOCUS but it works only on the last surface thickness
Best answer by David.Nguyen 6 December 2021, 11:38
Sorry I wasn’t clear, this is not a limitation of ZPL. You can save the Merit funciton before and load it again once the quick adjust is done with the keywords SAVEMERIT and LOADMERIT, I will update my answer with the proper lines of codes for you to try. You could even think about using DELETEFILE to remove the temporary file.
Let me know if it works for you.
Thank you for the detailed and complete answer! I was hoping there was a way of doing it without touching the Merit function, but this method works as expected
To the best of my knowledge, there isn’t such a keyword readily available. However, I can think of two workarounds.
First, you can reproduce the Quick Adjust feature in ZPL. There is one limitation (described below), but this allows you to stick with the ZPL langage. Here’s an example of what could be done:
# Edit surface:adjust_surface = 3# Edit parameter (0: Radius | 1: Thickness):parameter = 1# Edit criterion (1: Spot Size Radial | 2: Spot Size X Only# 3: Spot Size Y Only)criterion = 1# Edit evaluation surface:eval_surface = 4# Save Merit FunctionSAVEMERIT "temporary.MF"# Clear Merit FunctionDELETEMFO ALL# Setup Default Merit FunctionDEFAULTMERIT 0, criterion, 0, 1, 3, 6, 1, -1, 0, -1, 1, 1, 0# Clear variablesREMOVEVARIABLES# Setup variableIF (parameter == 0) SOLVETYPE adjust_surface, CV, 1, 1, 1, 1ELSE SOLVETYPE adjust_surface, TV, 1, 1, 1, 1ENDIF# OptimizeOPTIMIZE# UpdateUPDATE ALL# Clear Merit FunctionDELETEMFO ALL# Load Merit FunctionLOADMERIT "temporary.MF"# Clear variablesREMOVEVARIABLES
In the screenshots below, I’m illustrating the macro behaviour (before/after) on a dummy file:
The main limitation is that you can’t seem to generate an angular Default Merit Function.
Second, the Quick Adjust feature is available through the ZOS-API. So, you may want to switch from ZPL to ZOS-API for your application. See the ZOS-API Syntax Help excerpt below:
Let me know if this helps, and take care,
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.
Do not provide any information or data that is restricted by applicable law, including by the People’s Republic of China’s Cybersecurity and Data Security Laws (
e.g., Important Data, National Core Data, etc.).