To install PyZDDE use a command prompt and cd
to the extracted folder. Then execute
python setup.py install
PyZDDE comes with few ZPL macro files that are present in the directory "ZPLMacros". They are occasionally used by PyZDDE (for example in the function ipzCaptureWindowLQ()
). Please copy/move the files from the folder "ZPLMacros" to the folder where Zemax/ Optic studio expects to find ZPL macros (By default, this folder is C:\<username>\Documents\ZEMAX\Macros
). A copy of the "ZPLMacros" folder is always available in (installed with) the PyZDDE package.
Examples shipped with PyZDDE are in the folder "Examples". Please move the examples to your desired location after extracting the PyZDDE package.
Start Zemax/ OpticStudio, import PyZDDE in a script/ IPython notebook, create a DDE communication channel, control/ communicate/ ray-trace, etc in Zemax, and close the link. For example, the following is a simple Hello world
program.
import pyzdde.zdde as pyz
ln = pyz.createLink()
print("Hello Zemax version: ", ln.zGetVersion())
ln.close()
import pyzdde.zdde as pyz
): The main module in PyZDDE that provides all dataitems related functions for interacting with Zemax/OpticStudio using the DDE interface.import pyzdde.arraytrace as at
): provides functions for tracing large number of raysimport pyzdde.zfileutils as zfu
): provides helper functions for various Zemax file handling operations such as reading and writing beam files, .ZRD files, creating .DAT and .GRD files for grid phase /grid sag surfaces, etc.import pyzdde.systems as osys
): provides helper functions for quickly creating basic optical systems.Getting started with PyZDDE is really very simple as shown in the "Hello world" program above. Please refer to the [GitHub wiki page](https://github.com/indranilsinharoy/PyZDDE/wiki). It has detailed guide on how to start using PyZDDE. The wiki also has various other documentation on several topics. Please refer to the GitHub wiki documentation. Also, examples included with PyZDDE are viewable [here](http://nbviewer.ipython.org/github/indranilsinharoy/PyZDDE/tree/master/Examples/).