I am writing an Interactive Extension with python (following this KB article) and want to have the 3D Layout window update. Apparently, with these extensions, the default UpdateMode is set to Editors only.
I searched the KnowledgeBase and found two relevant articles:
https://my.zemax.com/en-US/Knowledge-Base/kb-article/?ka=KA-01828#EditorsOnly
Unfortunately, these explain how to do this for MATLAB only, and I am very confused about “ZOSAPI' vs. “TheSystem' vs. “constants' etc. I “translated' both options in the first KnowledgeBase article from MATLAB to python and tried them:
Option 1:
TheSystem.UpdateMode=constants.LensUpdateMode.AllWindows
This produces “AttributeError: LensUpdateMode”. I also tried replacing 'constants' with 'TheSystem', 'TheApplication', etc.
Option 2:
for i in range(1,TheSystem.Analyses.NumberOfAnalyses):
TheSystem.Analyses.Get_AnalysisAtIndex(i).ApplyAndWaitForCompletion();
This does not throw an error, but it also does not update the 3D Layout (which I had previously saved with the file)
Can anyone provide an example of setting “Update All Windows” for python? Or for manually updating with ApplyAndWaitForCompletion?
Thanks and best wishes,
Tom