Surface Property Updating, but results not changing without manual refresh

  • 10 September 2020
  • 2 replies




I am doing a polarizaiton analysis and am running into an issue when it comes to updating my surfaces. I have a short macro that updates the tilt about x for a coordinate break before a mirror, and the tilt about x for a coordinate break after a mirror. Then, I am using the OPEV function to get the transmission of a surface further in the system. The problem is, when I use the macro to udpate the tilts, the results don't show in the OPEV function unless I manually refresh the results. This will not work for me as I am working with a very large data set and thus need to be able to do it without manually refreshing. Just a simple example of the setup is given below. 


SETSURFACEPROPERTY 8, 10, 3, 3 # sets the tilt about x before the mirror (surface 9)

SETSURFACEPROPERTY 10, 10, -3, 3 # resents the tilt about x for the whole system, esentially just tilting the mirror in the whole system

code_coda = OCOD('CODA') # defining the merit function code used to get the transmission

transmission = OPEV(code_coda, 44, 1, 1, 0, 0, 0) # solving for transmission, this value should change depending on tilt 

print transmission 


My problem is that the transmission does not change unless I manually hit refresh in the text viewer. Why is this happening? How can I change the tilts in a loop to update the transmission value?


Best answer by Hui Chen 10 September 2020, 20:27

View original

2 replies

Userlevel 4
Badge +1

Hi Isaiah,

Thank you for your post!

In the ZPL maco after the two SETSURFACEPROPERTY lines and before the 'OCOD' line, could you please try adding an UPDATE ALL command? Any changes made to the prescription data in the LDE, such as radius of curvature, thickness, or tilts, needs to be followed by an UPDATE command to update the prescription before tracing or evaluating a system.

You can find this described in the Help File at The Programming Tab > About the ZPL > KEYWORDS (about the zpl) > UPDATE

Let me know if this fixes the issue.

Best regards,



That's it! Thank you so much.