ZEMAX Users' Knowledge Base

Extensions


    This article describes how to allow programs that support Visual Basic for Applications to communicate with ZEMAX.


    This article describes how to compile an Extension using the Microsoft Visual Studio C++ compiler.

    How Do I Write an Extension in C?

    ZEMAX has a very powerful feature which allows another Windows program to establish a communication link with ZEMAX, and for this other program to get data from ZEMAX on the lens. This is called an Extension. A program can therefore use ZEMAX to trace rays through an optical system, and then receive data back from ZEMAX.

    This article shows how to write a simple "hello world" program to link a user-written C-program to ZEMAX.

    This article is also available in Japanese.

    How to Talk to ZEMAX from MatLab

    This article describes:
    • How to set up a communication link between ZEMAX and MatLab®
    • How to use the ZEMAX DDE Toolbox for MatLab
    • Common problems and how to solve them

    User-defined objects, scatter functions, sources etc are dll programs that communicate with ZEMAX. In this article I show how to write such programs in Fortran. Sample code is provided.

    This article describes how one user took advantage of the published C-language code for ZCLIENT.C, the program that provides Dynamic Data Exchange (DDE) functionality with ZEMAX, to modify it so that the main utility functions provided in that code could be called from a user-provided FORTRAN function instead of having to use the C- or C++ language.