ZEMAX
has hundreds of features that cover the vast majority of user
needs for optical design and analysis. However, no matter how
many features a program has, there always seems to be the need
for a custom analysis or computation.
For these cases,
ZEMAX offers three different approaches to performing your own
calculations.
The first approach
is the 1D/2D Universal Plot. This plot looks
like a normal ZEMAX calculation window, except that you can
define what is on the x and y axes directly.
The independent
variables can be any system parameter (wavelength, field, temperature,
pressure), or any surface parameter (radius of curvature, thickness
etc). The dependent variable can be the merit function, any
optimisation operand, or a macro (macros as discussed later
on this page).

For example,
this 2D universal plot screenshot shows the variation in power
(W/mm^2) with front and back radius of curvature for a singlet
lens in NSC. But it could just as easily show how MTF varies
with the conic constant on surface 5, how spherical aberration
varies with aperture, or many, many other features.
The
next approach is the macro. Macros use a simple,
BASIC-like language called the ZEMAX Programming
Language (ZPL). ZPL uses simple BASIC-like commands such as
PRINT and GOTO, and also addsan extensive library of new
keywords such as RAYTRACE and GETMTF that can be used to extract
data computed by ZEMAX.

A typical macro
ZPL supports
inline function calls, user defined variables, text and graphical
output, and a simple interface to the ray tracing algorithms.
ZPL macros can read and write ASCII files to format custom data
reports. It is ideal if the information you need can be quickly
calculated from ray-trace data.
The third,
and most powerful technique is to write your own program
to control ZEMAX. ZEMAX is designed to operate in a
client-server architecture; with ZEMAX being the server, and
any other Windows program being the client. ZEMAX can be used
to load existing or create new lens files, trace rays, and optimize,
all under the transparent control of an external program.
One application for this technology is the extension of ZEMAX
with user written programs to provide a user defined feature
capability. These features are tightly integrated with the ZEMAX
user interface. The extended features appear as menu items,
and output is displayed as a standard ZEMAX feature.
Alternatively, the client-server architecture can be used for
a third party program that only needs the ZEMAX server, and
not the ZEMAX interface or graphics.
In either case, the programming language is C or C++ and all
the power and flexibility of the common programming development
tools are available.
Using C, you
can write your own analysis features, optimization operands,
optical surfaces and sources. This gives you total control over
every capability in the program.