ZOS-API Matlab - How to load an archive ZAR file

  • 21 July 2020
  • 1 reply
  • 101 views

Userlevel 6
Badge +2

In ZOS-API what functions do we use to open an archive file and select the same options as the interface?



1 reply

Userlevel 6
Badge +2

To reproduce this, I have connected OpticStudio Interactive extension to Matlab :


>> TheApplication=ans;

>> TheSystem=TheApplication.PrimarySystem;

>> ZAR_Tools=TheSystem.Tools.OpenRestoreZAR;

>> OpenStatus = ZAR_Tools.SetFileName('E:\Zemax\Samples\Sequential\Objectives\Double Gauss 28 degree field.zar');

>> ZAR_Tools.SetFilesAllOverwrite();

>> ZAR_Tools.GetOutputFolder

ans =

E:\Zemax\SAMPLES

>> ZAR_Tools.SetOutputFolder('E:\Zemax\Samples\Sequential\Objectives');

>> ZAR_Tools.RunAndWaitForCompletion();

>>

 


So the main point to know is that IRestoreArchive is an interface that can be accessed from the IOpticalSystemTools interface, so with this line:


>> TheSystem=TheApplication.PrimarySystem;

>> ZAR_Tools=TheSystem.Tools.OpenRestoreZAR;

 

Reply