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
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?
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:
- 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
Connecting to the Interactive Extension using MATLAB
Connecting to the Interactive Extension using Python
Next article: How to create a User-Extension: Converting from Chebyshev to Extended Polynomial
Article is closed for comments.