Skip to main content

ZOS-API interface 2025 R1

ZOSAPI.Editors.TDE.IToleranceDataEditor Interface Reference

Last update: 17.07.2025

This interface defines all properties and methods needed to interact with the Tolerance Data Editor. This interface can be accessed via the IOpticalSystem interface. More...

Inheritance diagram for ZOSAPI.Editors.TDE.IToleranceDataEditor:

Public Member Functions

ITDERow GetOperandAt (int OperandNumber)
 Gets the data for the specified operand.
 
ITDERow InsertNewOperandAt (int OperandNumber)
 Inserts a new operand at the specified position.
 
ITDERow AddOperand ()
 Adds a new operand as the last operand in the system.
 
bool RemoveOperandAt (int OperandNumber)
 Removes the operand at the specified location.
 
int RemoveOperandsAt (int OperandNumber, int numOperands)
 Removes one or more operands at the specified location.
 
bool ShowTDE ()
 Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
 
void HideTDE ()
 Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
 
bool LoadToleranceFile (string fileName)
 Loads a tolerance file, replacing the tolerances in the current lens.
 
void SaveToleranceFile (string fileName)
 Saves the current tolerances to a file.
 
int CopyOperands (int fromOperandNumber, int NumberOfOperands, int toOperandNumber)
 Copy and paste the specified number of operands from one location to another.
Note that it is okay for the source and destination to overlap.
 
int CopyOperandsFrom (IToleranceDataEditor fromEditor, int fromOperandNumber, int NumberOfOperands, int toOperandNumber)
 Copy and paste the specified number of operands from one location (in the specified system) to another location (in this system). Note that it is okay for the source and destination to overlap.
 
- Public Member Functions inherited from ZOSAPI.Editors.IEditor
IEditorRow GetRowAt (int pos)
 Gets the row at the specified index (0 to NumberOfRows-1).
 
IEditorRow InsertRowAt (int pos)
 Inserts a new row at the specified index (0 to NumberOfRows). Note that some editors - such as the Lens Data Editor may not allow inserting new rows before the first row.
 
IEditorRow AddRow ()
 Adds a new row at the end of the editor.
 
bool DeleteRowAt (int pos)
 Deletes a row at the specified index (0 to NumberOfRows-1). Note that all editors require at least one row, and some editors may require more than that.
 
int DeleteRowsAt (int pos, int numberOfRows)
 Deletes one or more rows at the specified index (0 to NumberOfRows-1).
 
int DeleteAllRows ()
 Deletes all rows from the current editor.
 
bool ShowEditor ()
 Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
 
void HideEditor ()
 Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
 

Properties

int RowToOperandOffset [get]
 Offset from a row index to operand index (always 1).
 
int NumberOfOperands [get]
 Gets the total number of operands in the current system.
 
ToleranceColumn FirstColumn [get]
 Gets the first available column.
 
ToleranceColumn LastColumn [get]
 Gets the last available column.
 
INSCToleranceWizard NSCToleranceWizard [get]
 The Nonsequential Tolerance Wizard.
 
ISEQToleranceWizard SEQToleranceWizard [get]
 The Sequential Tolerance Wizard.
 
- Properties inherited from ZOSAPI.Editors.IEditor
EditorType Editor [get]
 Gets the type of this editor instance.
 
int NumberOfRows [get]
 Gets the number of rows in this editor. Note that this referes to surfaces, objects, or operands depending on editor type.
 
int MinColumn [get]
 The minimum column index that can be used in calls to IEditorRow.GetCellAt for any IEditorRow retrieved from this editor.
 
int MaxColumn [get]
 The maximum column index that can be used in calls to IEditorRow.GetCellAt for any IEditorRow retrieved from this editor.
 

Detailed Description

This interface defines all properties and methods needed to interact with the Tolerance Data Editor. This interface can be accessed via the IOpticalSystem interface.

Member Function Documentation

◆ AddOperand()

ITDERow ZOSAPI.Editors.TDE.IToleranceDataEditor.AddOperand ( )

Adds a new operand as the last operand in the system.

Returns

◆ CopyOperands()

int ZOSAPI.Editors.TDE.IToleranceDataEditor.CopyOperands ( int  fromOperandNumber,
int  NumberOfOperands,
int  toOperandNumber 
)

Copy and paste the specified number of operands from one location to another.
Note that it is okay for the source and destination to overlap.

Parameters
fromOperandNumberFirst operand number to copy (1 to NumberOfOperands).
NumberOfOperandsThe number of operands to copy.
toOperandNumberRow to start inserting the operands (1 to NumberOfOperands+1).
Returns
The number of operands actually copied.

◆ CopyOperandsFrom()

int ZOSAPI.Editors.TDE.IToleranceDataEditor.CopyOperandsFrom ( IToleranceDataEditor  fromEditor,
int  fromOperandNumber,
int  NumberOfOperands,
int  toOperandNumber 
)

Copy and paste the specified number of operands from one location (in the specified system) to another location (in this system). Note that it is okay for the source and destination to overlap.

Parameters
fromEditorSystem to copy the operands from.
fromOperandNumberFirst operand number to copy (1 to NumberOfOperands).
NumberOfOperandsThe number of operands to copy.
toOperandNumberTo operand number (1 to NumberOfOperands+1).
Returns
The number of operands actually copied.

◆ GetOperandAt()

ITDERow ZOSAPI.Editors.TDE.IToleranceDataEditor.GetOperandAt ( int  OperandNumber)

Gets the data for the specified operand.

Parameters
OperandNumberThe operand number (1 to NumberOfOperands).
Returns

◆ HideTDE()

void ZOSAPI.Editors.TDE.IToleranceDataEditor.HideTDE ( )

Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.

Returns

◆ InsertNewOperandAt()

ITDERow ZOSAPI.Editors.TDE.IToleranceDataEditor.InsertNewOperandAt ( int  OperandNumber)

Inserts a new operand at the specified position.

Parameters
OperandNumberThe operand number (1 to NumberOfOperands+1).
Returns

◆ LoadToleranceFile()

bool ZOSAPI.Editors.TDE.IToleranceDataEditor.LoadToleranceFile ( string  fileName)

Loads a tolerance file, replacing the tolerances in the current lens.

Parameters
fileNameName of the input file.

If the file name contains the complete path, such as C:\MYDIR\MYLENS.TOL, then the specified file will be loaded. If the path is left off, then the [data]\Tolerance folder will be used.

Returns
Exceptions
System.ArgumentExceptionInvalid file name

◆ RemoveOperandAt()

bool ZOSAPI.Editors.TDE.IToleranceDataEditor.RemoveOperandAt ( int  OperandNumber)

Removes the operand at the specified location.

Parameters
OperandNumberThe operand number (1 to NumberOfOperands).
Returns
true if the operand was successfully remove; otherwise, false.

◆ RemoveOperandsAt()

int ZOSAPI.Editors.TDE.IToleranceDataEditor.RemoveOperandsAt ( int  OperandNumber,
int  numOperands 
)

Removes one or more operands at the specified location.

Parameters
OperandNumberThe first operand number to remove (1 to NumberOfOperands).
numOperandsThe number operands to remove.
Returns
The number of operands actually removed.

◆ SaveToleranceFile()

void ZOSAPI.Editors.TDE.IToleranceDataEditor.SaveToleranceFile ( string  fileName)

Saves the current tolerances to a file.

Parameters
fileNameName of the output file.

If the file name contains the complete path, such as C:\MYDIR\MYLENS.TOL, then the specified file will be created. If the path is left off, then the [data]\Tolerance folder will be used.

Exceptions
System.ArgumentExceptionInvalid file name

◆ ShowTDE()

bool ZOSAPI.Editors.TDE.IToleranceDataEditor.ShowTDE ( )

Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.

Returns

Property Documentation

◆ FirstColumn

ToleranceColumn ZOSAPI.Editors.TDE.IToleranceDataEditor.FirstColumn
get

Gets the first available column.

The first column.

◆ LastColumn

ToleranceColumn ZOSAPI.Editors.TDE.IToleranceDataEditor.LastColumn
get

Gets the last available column.

The last column.

◆ NSCToleranceWizard

INSCToleranceWizard ZOSAPI.Editors.TDE.IToleranceDataEditor.NSCToleranceWizard
get

The Nonsequential Tolerance Wizard.

Returns

◆ NumberOfOperands

int ZOSAPI.Editors.TDE.IToleranceDataEditor.NumberOfOperands
get

Gets the total number of operands in the current system.

The number of operands.

◆ RowToOperandOffset

int ZOSAPI.Editors.TDE.IToleranceDataEditor.RowToOperandOffset
get

Offset from a row index to operand index (always 1).

The row to operand offset.

◆ SEQToleranceWizard

ISEQToleranceWizard ZOSAPI.Editors.TDE.IToleranceDataEditor.SEQToleranceWizard
get

The Sequential Tolerance Wizard.

Usage (see Example 14 for a full sample)

C#

// Set up the Tolerance Wizard and run it
ZOSAPI.Wizards.ISEQToleranceWizard 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();
Interface for the Tolerance Editor, Sequential Wizard These settings can be retrieved from the ZOSAPI...
Definition: InterfacesWizards.cs:566
void OK()
Settings are set, perform the wizardry.

C++

// Set up the Tolerance Wizard and run it
// Need to make sure you have x64 set to the platform, otherwise COM will throw an error
ZOSAPI_Interfaces::ISEQToleranceWizardPtr tWiz = TheSystem->TDE->SEQToleranceWizard;
// Specify surface tolerances
tWiz->ToleranceSettings->SurfaceRadius = 0.1;
tWiz->ToleranceSettings->SurfaceThickness = 0.1;
tWiz->ToleranceSettings->SurfaceDecenterX = 0.1;
tWiz->ToleranceSettings->SurfaceDecenterY = 0.1;
tWiz->ToleranceSettings->SurfaceTiltX = 0.2;
tWiz->ToleranceSettings->SurfaceTiltY = 0.2;
// Specify element tolerances
tWiz->ToleranceSettings->ElementDecenterX = 0.1;
tWiz->ToleranceSettings->ElementDecenterY = 0.1;
tWiz->ToleranceSettings->ElementTiltXDegrees = 0.2;
tWiz->ToleranceSettings->ElementTiltYDegrees = 0.2;
// Specify tolerances not to be used
tWiz->ToleranceSettings->IsSurfaceSandAIrregularityUsed = false;
tWiz->ToleranceSettings->IsIndexUsed = false;
tWiz->ToleranceSettings->IsIndexAbbePercentageUsed = false;
// Select OK
tWiz->ToleranceSettings->CommonSettings->OK();

Matlab

% 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();

Python

# Set up 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
tWiz.OK()
Returns

Connect with Ansys