How to debug a DLL or EXE

This article shows a technique to attach the Visual Studio debugger to a running process in the case of a user defined surface (DLL) and in the case of a user defined operand called UDOC (EXE). The technique is shown here using Microsoft Visual Studio Express 2013 Desktop.

Compile the DLL or EXE
Open OpticStudio and select the user defined surface or operand
Attach to Process
Set Breakpoints
Run the DLL/EXE
Stop the debugger
Distributing the DLL/EXE in Release Mode
Conclusion



 

Authored By: Michael Humphreys, Sandrine Auriol and Tim Gustafson

Published On: July 11, 2017


Support Material for ZOS-API Users

Support Material for ZOS-API Users

Authored By: Tess Jacobs


Getting Started with Python

This article will walk through the basics of getting Python setup on your system in order to run ZOS-API.  There are 2 required downloads (Python and pywin32) along with a few recommended downloads (an IDE and Python modules).   Except for the 2 required downloads, all other recommendations are based on a Zemax Engineer's personal preference and do not reflect an official endorsement as to the quality of these products or any competitors.

CONTENTS:

Authored By: Michael Humphreys

Published On: November 14, 2016


How to Connect to the ZOS-API with the Interactive Extension using Matlab

In this article, we will show how to connect to the ZOS-API with the new Interactive Extension using Matlab. The Interactive Extension mode is almost identical to a User Extension except an Interactive Extension does not have to be a standalone executable. This capability allows connections from scripting environments such as Matlab or Python where there is no compiled executable that OpticStudio can launch. 
 

Authored By: Thomas Pickering

Published On: August 29, 2016


ZOS-API using MATLAB

This article is intended to provide sample code for performing specific actions using the ZOS-API through MATLAB.  For similar examples in Python, please click here.  For more general information about the ZOS-API, please instead visit the resources listed below.

CONTENTS:

  1. Sequential Single Ray Trace
  2. Create NSC and Insert Object
  3. Change Parameter in Sequential
  4. Create Solve in Sequential
  5. Insert Operand (Index To 10 Decimal Points)
  6. Run an NSC Ray Trace with Filter String
  7. Read Data from a ZRD File
  8. Sequential Batch Raytrace

Authored By: Michael Humphreys

Published On: September 20, 2016


ZOS-API using Python

This article is intended to outline differences between using Python and other ZOSAPI languages and review how Python (2.x) handles enumerated variables.  Working sample code snippets are provided.  
For MATLAB examples, please click here.  For more general information about the ZOS-API, please instead visit the resources listed below.

CONTENTS:

Authored By: Michael Humphreys

Published On: June 28, 2016


How to create a User Analysis using ZOS-API

In this article, we will show how to create a User Analysis using the new ZOS-API.NET.

  • Vary thickness of a surface in steps of 10 μm
  • Run QuickFocus to bring image plane into focus
  • For each step, calculate FFT MTF at several spatial frequencies
  • Plot data

Authored By: Thomas Aumeyr

Published On: November 26, 2015


Interfacing to OpticStudio from Mathematica

This article provides an example of the standalone method, in which the external application is Mathematica. A Mathematica notebook is used as a user interface and scripting language. It will start an OpticStudio session, load an existing lens file, manipulate that lens file to alter the lens design, perform an analyses, and obtain and process the results to provide information not directly available through OpticStudio.

Published On: May 3, 2015


ZOS-API.NET: An Overview

An application programming interface (API) for OpticStudio enables connections to, and customization of, the application using the latest software technology.

Published On: May 3, 2015