ZOSAPI.Tools.Tolerancing.ITolerancing Interface Reference
Last update: 17.07.2025Interfaces and methods for running Tolerancing. This interface can be accessed via the IOpticalSystemTools interface. More...
Inheritance diagram for ZOSAPI.Tools.Tolerancing.ITolerancing:

Public Member Functions | |
| bool | Save (string filename) |
| bool | Load (string filename) |
| bool | Reset () |
| string | GetSetupModeAt (int idx) |
| string | GetSetupPolynomialAt (int idx) |
| string | GetSetupCacheAt (int idx) |
| string | GetSetupChangeAt (int idx) |
| string | GetSetupCoreAt (int idx) |
| string | GetCriterionAt (int idx) |
| string | GetCriterionSampleAt (int idx) |
| string | GetCriterionCompAt (int idx) |
| string | GetCriterionConfigurationAt (int idx) |
| string | GetCriterionFieldAt (int idx) |
| string | GetCriterionCycleAt (int idx) |
| string | GetCriterionScriptAt (int idx) |
| Gets the name of the criterion script at the specified index. | |
| string | GetMonteCarloStatisticAt (int idx) |
| string | GetDisplayShowWorstAt (int idx) |
| void | SetPartialMCTMode () |
| bool | EstimateHPCTime () |
Public Member Functions inherited from ZOSAPI.Tools.ISystemTool | |
| bool | Run () |
| Start the tool. Note that for synchronous tools (see IsAsynchronous), this call will block until completion. If it is asynchronous it will start running but return immediately. | |
| bool | RunAndWaitForCompletion () |
| Sames as calling Run followed by WaitForCompletion. | |
| bool | WaitForCompletion () |
| Waits for the asynchronous tool to complete. | |
| bool | Cancel () |
| Cancels the currently running asynchronous tool. | |
| bool | Close () |
| Closes this tool and frees up and associated resources. | |
| RunStatus | WaitWithTimeout (double timeOutSeconds) |
| Waits for the currently running tool to complete, with a specified time out value. Note that if the timeout is exceeded this method will return, however the tool will continue to run. Also note that this method will not start the tool running if it is not already. | |
| RunStatus | RunAndWaitWithTimeout (double timeOutSeconds) |
| Starts the tool running, and waits for it to complete with the specified timeout value. Note that if the timeout is exceeded this method will return, however the tool will continue to run. | |
Properties | |
| string | ResultFilename [get] |
| bool | IsForceRayAimingUsed [get, set] |
| bool | IsSeperateFieldConfigurationsUsed [get, set] |
| SetupModes | SetupMode [get, set] |
| int | SetupModeIndex [get, set] |
| int | NumberOfSetupModes [get] |
| SetupPolynomials | SetupPolynomial [get, set] |
| int | SetupPolynomialsIndex [get, set] |
| int | NumberOfSetupPolynomials [get] |
| SetupCaches | SetupCache [get, set] |
| int | SetupCacheIndex [get, set] |
| int | NumberOfSetupCaches [get] |
| SetupChanges | SetupChange [get, set] |
| int | SetupChangeIndex [get, set] |
| int | NumberOfSetupChanges [get] |
| int | SetupCore [get, set] |
| int | SetupCoreIndex [get, set] |
| int | NumberOfSetupCores [get] |
| double | MaximumCriteria [get, set] |
| double | MTFFrequency [get, set] |
| Criterions | Criterion [get, set] |
| int | CriterionIndex [get, set] |
| int | NumberOfCriteria [get] |
| int | CriterionSampling [get, set] |
| int | CriterionSamplingIndex [get, set] |
| int | NumberOfCriterionSamplings [get] |
| CriterionComps | CriterionComp [get, set] |
| int | CriterionCompIndex [get, set] |
| int | NumberOfCriterionComps [get] |
| int | CriterionConfiguration [get, set] |
| int | CriterionConfigurationIndex [get, set] |
| int | NumberOfCriterionConfigurations [get] |
| CriterionFields | CriterionField [get, set] |
| int | CriterionFieldIndex [get, set] |
| int | NumberOfCriterionFields [get] |
| int | CriterionCycle [get, set] |
| int | CriterionCycleIndex [get, set] |
| int | NumberOfCriterionCycles [get] |
| int | CriterionScript [get, set] |
| int | CriterionScriptIndex [get, set] |
| int | NumberOfCriterionScripts [get] |
| int | NumberOfRuns [get, set] |
| int | NumberToSave [get, set] |
| bool | IsSaveBestWorstUsed [get, set] |
| bool | IsOverlayGraphicsUsed [get, set] |
| string | FilePrefix [get, set] |
| MonteCarloStatistics | MonteCarloStatistic [get, set] |
| int | MonteCarloStatisticIndex [get, set] |
| int | NumberOfMonteCarloStatistics [get] |
| bool | IsShowDescriptionsUsed [get, set] |
| bool | IsShowCompensatorsUsed [get, set] |
| bool | IsHideAllButWorstUsed [get, set] |
| string | OutputFile [get, set] |
| int | DisplayShowWorst [get, set] |
| int | DisplayShowWorstIndex [get, set] |
| int | NumberOfDisplayShowWorsts [get] |
| bool | UseDataRetention [get, set] |
| bool | OpenDataViewer [get, set] |
| bool | SaveTolDataFile [get, set] |
| string | TolDataFile [get, set] |
| bool | IsHPCEnabled [get] |
| double | HPCEstimatedTimeS [get] |
| double | HPCRemainingTimeS [get] |
| double | HPCTimeToStartS [get] |
| int | HPCQueuePosition [get] |
| HPCRunState | HPCState [get] |
| bool | HPCHasTimeEstimate [get] |
| string | BestWorstOutputFolder [get] |
Properties inherited from ZOSAPI.Tools.ISystemTool | |
| int | Progress [get] |
| Gets the progress of the current tool, if supported. | |
| string | Status [get] |
| Gets the status of the current tool, if supporoted. | |
| bool | IsRunning [get] |
| Gets a value indicating whether the tool is currently running asynchronously. | |
| bool | CanCancel [get] |
| Gets a value indicating whether the tool can be cancelled. | |
| bool | IsAsynchronous [get] |
| Gets a value indicating whether the tool runs asynchronously (i.e. on a thread). | |
| bool | IsFiniteDuration [get] |
| Gets a value indicating whether this tool will complete on its own. | |
| bool | IsValid [get] |
| Gets a value indicating whether the input settings are valid. | |
| bool | Succeeded [get] |
| Gets a value indicating whether the tool execution succeeded. | |
| string | ErrorMessage [get] |
If Succeeded is false, get the error messages; otherwise, null. | |
Detailed Description
Interfaces and methods for running Tolerancing. This interface can be accessed via the IOpticalSystemTools interface.
Usage (see Example 14 for a full sample)
C#
// Set up the Tolerancing analysis and run it
ZOSAPI.Tools.Tolerancing.ITolerancing tol = TheSystem.Tools.OpenTolerancing();
// Select Sensitivity mode
// Select Criterion and related settings
tol.CriterionSampling = 3;
tol.CriterionCycle = 2;
// Select the number or MC runs and files to save
tol.NumberOfRuns = 20;
tol.NumberToSave = 20;
// Run the Tolerancing analysis
tol.RunAndWaitForCompletion();
tol.Close();
bool RunAndWaitForCompletion()
Sames as calling Run followed by WaitForCompletion.
Interfaces and methods for running Tolerancing. This interface can be accessed via the IOpticalSystem...
Definition: ITolerancing.cs:137
Definition: ITolerancing.cs:5
Definition: FileSource.cs:4
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5
C++
// Set up the Tolerancing analysis and run it
ZOSAPI_Interfaces::ITolerancingPtr tol = TheSystem->Tools->OpenTolerancing();
// Select Sensitivity mode
tol->SetupMode = ZOSAPI_Interfaces::SetupModes_Sensitivity;
// Select Criterion and related settings
tol->Criterion = ZOSAPI_Interfaces::Criterions_RMSSpotRadius;
tol->CriterionSampling = 3;
tol->CriterionComp = ZOSAPI_Interfaces::CriterionComps_OptimizeAll_DLS;
tol->CriterionCycle = 2;
tol->CriterionField = ZOSAPI_Interfaces::CriterionFields_UserDefined;
// Select the number or MC runs and files to save
tol->NumberOfRuns = 20;
tol->NumberToSave = 20;
// Run the Tolerancing analysis
ZOSAPI_Interfaces::ISystemToolPtr baseTool = tol;
baseTool->RunAndWaitForCompletion();
baseTool->Close();
Matlab
% Set up the Tolerancing analysis and run it
tol = TheSystem.Tools.OpenTolerancing();
% Select Sensitivity mode
% Select Criterion and related settings
tol.CriterionSampling = 3;
tol.CriterionCycle = 2;
% Select the number or MC runs and files to save
tol.NumberOfRuns = 20;
tol.NumberToSave = 20;
% Run the Tolerancing analysis
tol.RunAndWaitForCompletion();
tol.Close();
@ Sensitivity
Python
# Set up Tolerancing analysis and run it
tol = TheSystem.Tools.OpenTolerancing()
# Select Sensitivity mode
tol.SetupMode = ZOSAPI.Tools.Tolerancing.SetupModes.Sensitivity
# Select Criterion and related settings
tol.Criterion = ZOSAPI.Tools.Tolerancing.Criterions.RMSSpotRadius
tol.CriterionSampling = 3
tol.CriterionComp = ZOSAPI.Tools.Tolerancing.CriterionComps.OptimizeAll_DLS
tol.CriterionCycle = 2
tol.CriterionField = ZOSAPI.Tools.Tolerancing.CriterionFields.UserDefined
# Select number of MC runs and files to save
tol.NumberOfRuns = 20
tol.NumberToSave = 20
# Run the Tolerancing analysis
tol.RunAndWaitForCompletion()
tol.Close()
- Examples
- CSharpStandalone_14_Seq_Tolerance.cs.
Member Function Documentation
◆ EstimateHPCTime()
| bool ZOSAPI.Tools.Tolerancing.ITolerancing.EstimateHPCTime | ( | ) |
◆ GetCriterionAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetCriterionAt | ( | int | idx | ) |
◆ GetCriterionCompAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetCriterionCompAt | ( | int | idx | ) |
◆ GetCriterionConfigurationAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetCriterionConfigurationAt | ( | int | idx | ) |
◆ GetCriterionCycleAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetCriterionCycleAt | ( | int | idx | ) |
◆ GetCriterionFieldAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetCriterionFieldAt | ( | int | idx | ) |
◆ GetCriterionSampleAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetCriterionSampleAt | ( | int | idx | ) |
◆ GetCriterionScriptAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetCriterionScriptAt | ( | int | idx | ) |
Gets the name of the criterion script at the specified index.
- Parameters
-
idx An index ( 0toNumberOfCriterionScripts-1).
- Returns
- The name of the script at index idx .
- Exceptions
-
ArgumentOutOfRangeException Thrown if idx is < 0 or >= NumberOfCriterionScripts.
◆ GetDisplayShowWorstAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetDisplayShowWorstAt | ( | int | idx | ) |
◆ GetMonteCarloStatisticAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetMonteCarloStatisticAt | ( | int | idx | ) |
◆ GetSetupCacheAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetSetupCacheAt | ( | int | idx | ) |
◆ GetSetupChangeAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetSetupChangeAt | ( | int | idx | ) |
◆ GetSetupCoreAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetSetupCoreAt | ( | int | idx | ) |
◆ GetSetupModeAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetSetupModeAt | ( | int | idx | ) |
◆ GetSetupPolynomialAt()
| string ZOSAPI.Tools.Tolerancing.ITolerancing.GetSetupPolynomialAt | ( | int | idx | ) |
◆ Load()
| bool ZOSAPI.Tools.Tolerancing.ITolerancing.Load | ( | string | filename | ) |
◆ Reset()
| bool ZOSAPI.Tools.Tolerancing.ITolerancing.Reset | ( | ) |
◆ Save()
| bool ZOSAPI.Tools.Tolerancing.ITolerancing.Save | ( | string | filename | ) |
◆ SetPartialMCTMode()
| void ZOSAPI.Tools.Tolerancing.ITolerancing.SetPartialMCTMode | ( | ) |
Property Documentation
◆ BestWorstOutputFolder
|
get |
◆ Criterion
|
getset |
◆ CriterionComp
|
getset |
◆ CriterionCompIndex
|
getset |
◆ CriterionConfiguration
|
getset |
◆ CriterionConfigurationIndex
|
getset |
◆ CriterionCycle
|
getset |
◆ CriterionCycleIndex
|
getset |
◆ CriterionField
|
getset |
◆ CriterionFieldIndex
|
getset |
◆ CriterionIndex
|
getset |
◆ CriterionSampling
|
getset |
◆ CriterionSamplingIndex
|
getset |
◆ CriterionScript
|
getset |
◆ CriterionScriptIndex
|
getset |
◆ DisplayShowWorst
|
getset |
◆ DisplayShowWorstIndex
|
getset |
◆ FilePrefix
|
getset |
◆ HPCEstimatedTimeS
|
get |
◆ HPCHasTimeEstimate
|
get |
◆ HPCQueuePosition
|
get |
◆ HPCRemainingTimeS
|
get |
◆ HPCState
|
get |
◆ HPCTimeToStartS
|
get |
◆ IsForceRayAimingUsed
|
getset |
◆ IsHideAllButWorstUsed
|
getset |
◆ IsHPCEnabled
|
get |
◆ IsOverlayGraphicsUsed
|
getset |
◆ IsSaveBestWorstUsed
|
getset |
◆ IsSeperateFieldConfigurationsUsed
|
getset |
◆ IsShowCompensatorsUsed
|
getset |
◆ IsShowDescriptionsUsed
|
getset |
◆ MaximumCriteria
|
getset |
◆ MonteCarloStatistic
|
getset |
◆ MonteCarloStatisticIndex
|
getset |
◆ MTFFrequency
|
getset |
◆ NumberOfCriteria
|
get |
◆ NumberOfCriterionComps
|
get |
◆ NumberOfCriterionConfigurations
|
get |
◆ NumberOfCriterionCycles
|
get |
◆ NumberOfCriterionFields
|
get |
◆ NumberOfCriterionSamplings
|
get |
◆ NumberOfCriterionScripts
|
get |
◆ NumberOfDisplayShowWorsts
|
get |
◆ NumberOfMonteCarloStatistics
|
get |
◆ NumberOfRuns
|
getset |
◆ NumberOfSetupCaches
|
get |
◆ NumberOfSetupChanges
|
get |
◆ NumberOfSetupCores
|
get |
◆ NumberOfSetupModes
|
get |
◆ NumberOfSetupPolynomials
|
get |
◆ NumberToSave
|
getset |
◆ OpenDataViewer
|
getset |
◆ OutputFile
|
getset |
◆ ResultFilename
|
get |
◆ SaveTolDataFile
|
getset |
◆ SetupCache
|
getset |
◆ SetupCacheIndex
|
getset |
◆ SetupChange
|
getset |
◆ SetupChangeIndex
|
getset |
◆ SetupCore
|
getset |
◆ SetupCoreIndex
|
getset |
◆ SetupMode
|
getset |
◆ SetupModeIndex
|
getset |
◆ SetupPolynomial
|
getset |
◆ SetupPolynomialsIndex
|
getset |
◆ TolDataFile
|
getset |
◆ UseDataRetention
|
getset |
Public Member Functions inherited from