- Home
- Programming ZEMAX
- ZPL
- How to Automate Keyboard and Mouse Actions with ZPL
How to Automate Keyboard and Mouse Actions with ZPL
Introduction
This article is also available in Japanese.
ZPL is very extensive, and one of its biggest benefits is the ability to automate tedious or repetitive tasks.
For example, imagine that you want observe the effects of the irradiance distribution due to a tilt of one or multiple elements in a complex optical system. Since it is possible for some non-sequential (NS) ray traces to take many hours to complete, this could take considerable time to evaluate. Without ZPL, you would have to start the initial ray trace, wait for it to finish, save the data, make the changes to the tilt of the desired object, re-run the ray trace, and repeat the process for each incremental tilt of the element.
With ZPL, you can run the macro and leave your computer until the entire process has been completed.
For demonstration purposes, we will qualitatively observe the fringe patterns in a Twyman-Green interferometer as a function of tilt of the test surface. The macro language will be used to automate the process of adjusting the tilt of the test plate, re-tracing the rays, and saving the fringe patterns to metafiles for later viewing and post-analysis.
How was this animation created? Find out here.
