Interactive Extension: FAQ

This article is part of the Getting Started with ZOS-API free tutorial.

This article answers some of the most frequently asked questions about the ZOS-API Interactive Extension, including how to update the analysis windows.

Authored By Sandrine Auriol

Introduction

The Interactive Extension allows a direct connection to an open instance of OpticStudio. This article will answer some of the most common questions about this tool.

In what language is the Interactive Extension available?

The Interactive extension is available for Matlab and Python.

When I make modifications using the Interactive Extension, only the editors are updated. What is happening?

When you connect to the Interactive Extension, the UpdateMode is changed to Editors Only. Only editors will be updated.

That choice is for speed. In the API, we are typically changing tens if not hundreds of parameters very quickly and that mode enables a quick change of the parameters. The original update mode is restored when the Interactive Extension is closed.

When I make modifications using the Interactive Extension, can I update the analysis windows?

Yes!

There are two ways to update the analysis windows.

  • The first one is to set the Update Mode back to AllWindows and then run an update. In Matlab the code will be:

    TheSystem.UpdateMode=ZOSAPI.LensUpdateMode.AllWindows;
    TheSystem.UpdateStatus();
  • The second one is to actually loop through the opened analysis windows and use the ApplyAndWaitForCompletion() methods to update the window.  The code for his in Matlab would look like:

    % update all analysis windows
    for i = 1:TheSystem.Analyses.NumberOfAnalyses
        TheSystem.Analyses.Get_AnalysisAtIndex(i).ApplyAndWaitForCompletion();
    end

KA-01828

Was this article helpful?
1 out of 2 found this helpful

Comments

0 comments

Article is closed for comments.