C:\Users\Simulations\Documents\Zemax\ZOS-API Sample Code\MATLAB\MATLABStandalone_14_Seq_Tolerance.m

  • 19 March 2021
  • 1 reply
  • 37 views

  • Single Emitter
  • 0 replies

in this code, I tried to read the number of operands after Setting up the Tolerance Wizard and running it, and see only two operands while it should be many. Anyone know why. Thanks for your kind help!


 %! [e14s02_m]


    % Set up the Tolerance Wizard and run it


    tWiz = TheSystem.TDE.SEQToleranceWizard;


    % Specify surface tolerances


    tWiz.SurfaceRadius = 0.1;


    tWiz.SurfaceThickness = 0.1;


    tWiz.SurfaceDecenterX = 0.1;


    tWiz.SurfaceDecenterY = 0.1;


    tWiz.SurfaceTiltX = 0.2;


    tWiz.SurfaceTiltY = 0.2;


    % Specify element tolerances


    tWiz.ElementDecenterX = 0.1;


    tWiz.ElementDecenterY = 0.1;


    tWiz.ElementTiltXDegrees = 0.2;


    tWiz.ElementTiltYDegrees = 0.2;


    % Specify tolerances not to be used


    tWiz.IsSurfaceSandAIrregularityUsed = false;


    tWiz.IsIndexUsed = false;


    tWiz.IsIndexAbbePercentageUsed = false;


    % Select OK


    tWiz.OK();


    %! [e14s02_m]


    


    %Customer Check


     TheTDE = TheSystem.TDE;


     TheTDE.NumberOfOperands


 


1 reply

Userlevel 5
Badge +2

Hi Lucy,


Thanks for your question here!


Did you try to run the full Standalone example, or just tried to run the above code snippet from a modified file?


Running the complete Standalone Application example #14 - Tolerancing, worked fine for me, and in this case I got 24 tolerance operands using the Double Gauss 28 degree field.zmx sample file from the \Documents\Zemax\Samples\Sequential\Objectives folder. Please find the resulting system attached as a .ZAR archive file.


I also ran a similar code from the Interactive Extension, while I had different files open in OpticStudio. In this case the code worked fine too, and I only got 2 operands when I had an empty new file open in OpticStudio, like this:



Is it possible that the file loading was not correct in your case, and you tried to set up the tolerance wizard on such a simple file?


Please find my .m MatLab files attached, and try to run these on your end.


I hope this helps, but if not or if you have any further questions, please let us know and we will be happy to help!


Best,

Csilla

Reply