Zemax Programming Extensions
Zemax is designed to operate in a client-server architecture. Zemax can be used to trace rays, do analysis, and optimize, all under the control of an external program.
One application for this technology is 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. Extensions are written in C or C++ and provide a compiled program extension capability. All items under the 'Extensions' menu in Zemax, are in fact external programs that simply integrate tightly into the Zemax user interface. For example, this Transmission Plot feature:
looks and feels exactly like a built-in Zemax feature, but it is instead an entirely separate program which is communicating with Zemax, telling it to trace rays, and then getting data, performing its own calculations and finally sending the data back to Zemax to be plotted and presented to the user via the normal interface. The source code for several sample extensions is provided with Zemax.
The other use is to provide a fast data communication channel between two programs running on the same machine. The most common example is MATLAB® and Visual Basic®. A Visual Basic example and full source code is provided
Related Knowledge Base articles:
How Do I Write an Extension in C?
How to Talk to Zemax from MATLAB