Skip to main content

ZOS-API interface 2024 R2 SP02

ZOSAPI.Editors.LDE.ILensDataEditor Interface Reference

Last update: 17.07.2025

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

Inheritance diagram for ZOSAPI.Editors.LDE.ILensDataEditor:

Public Member Functions

ILDERow GetSurfaceAt (int SurfaceNumber)
 Gets the data for the specified surface.
 
ILDERow InsertNewSurfaceAt (int SurfaceNumber)
 Inserts a new surface at the specified position.
 
ILDERow AddSurface ()
 Adds a new surface as the last surface in the system.
 
bool RemoveSurfaceAt (int SurfaceNumber)
 Removes the surface at the specified location.
 
int RemoveSurfacesAt (int SurfaceNumber, int numSurfaces)
 Removes one or more surfaces at the specified location.
 
bool ShowLDE ()
 Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
 
void HideLDE ()
 Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
 
ILDETool_AddCoatingsToAllSurfaces GetTool_AddCoatingsToAllSurfaces ()
 Gets the settings for the Add Coatings to All Surfaces tool.
 
void RunTool_AddCoatingsToAllSurfaces (ILDETool_AddCoatingsToAllSurfaces settings)
 Runs the Add Coatings to All Surfaces tool with the specified settings (GetTool_AddCoatingsToAllSurfaces).
 
void RunTool_RemoveAllApertures ()
 Remove All Apertures.
 
void RunTool_ConvertSemiDiametersToCircularApertures ()
 Convert Semi-Diameters to Circular Apertures.
 
void RunTool_ConvertSemiDiametersToFloatingApertures ()
 Convert Semi-Diameters to Floating Apertures.
 
void RunTool_ConvertSemiDiametersToMaximumApertures ()
 Convert Semi-Diameters to Maximum Apertures.
 
void RunTool_ReplaceVignettingWithApertures ()
 Replace Vignetting with Apertures.
 
CoordinateConversionResult RunTool_ConvertGlobalToLocalCoordinates (int FirstSurface, int LastSurface, ConversionOrder order)
 Converts Global to Local coordinates.
 
CoordinateConversionResult RunTool_ConvertLocalToGlobalCoordinates (int FirstSurface, int LastSurface, int referenceSurface)
 Converts Local to Global coordinates.
 
double GetApodization (double px, double py)
 This item computes the intensity apodization of a ray from the apodization type and value.
 
void GetFirstOrderData (out double EFL, out double paraxialWorkingFNumber, out double realWorkingFNumber, out double paraxialImageHeight, out double paraxialMagnification)
 This item extracts first order data about the lens.
 
bool GetGlass (int Surface, out string glassName, out double nd, out double vd, out double dpgf)
 Retrieve data about the glass on any surface.
 
bool GetGlobalMatrix (int Surface, out double R11, out double R12, out double R13, out double R21, out double R22, out double R23, out double R31, out double R32, out double R33, out double Xo, out double Yo, out double Zo)
 Get the matrix required to convert any local coordinates (such as from a ray trace) into global coordinates.
 
int GetIndex (int Surface, int NumberOfWavelengths, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)][In, Out]double[] indexAtWavelength)
 Extract refraction data for any surface.
 
bool SetLabel (int Surface, int label)
 Sets the integer label associated with the specified surface.
 
bool GetLabel (int Surface, out int label)
 Gets the integer label associated with the specified surface.
 
bool FindLabel (int label, out int Surface)
 Finds the surface associated with the specified integer label.
 
void GetPupil (out ZemaxApertureType type, out double ApertureValue, out double entrancePupilDiameter, out double entrancePupilPosition, out double exitPupilDiameter, out double exitPupilPosition, out PupilApodizationType ApodizationType, out double ApodizationFactor)
 Retrieve pupil data.
 
bool GetSag (int Surface, double X, double Y, out double sag, out double alternateSag)
 Gets the sag values(s) for the specified surface, in lens units.
 
int CopySurfaces (int fromSurfaceNumber, int NumberOfSurfaces, int toSurfaceNumber)
 Copy and paste the specified number of surfaces from one location to another.
Note that it is okay for the source and destination to overlap.
 
int CopySurfacesFrom (ILensDataEditor fromEditor, int fromSurfaceNumber, int NumberOfSurfaces, int toSurfaceNumber)
 Copy and paste the specified number of surfaces 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.
 
IMessage RunTool_ReverseElements (int firstSurface, int lastSurface)
 Reverses a lens element or group.
 
IMessage RunTool_AddFoldMirror (int Surface, TiltType tilt, double reflectAngle)
 Make the specified surface a fold mirror and inserts the required coordinate breaks to bend a beam.
 
IMessage RunTool_DeleteFoldMirror (int foldSurface)
 Deletes an existing fold mirror, including any neighboring coordinate breaks.
 
IMessage RunTool_MakeDoublePass (int reflectAtSurface)
 Create a second pass through the specified surfaces that represents a reflection propagating back through the optical system.
 
IMessage RunTool_MakeFocal (double focalLength)
 Scale the lens to the desired focal length.
 
bool CanConvertSurfaceToFreeform (int fromSurface)
 Checks if surface can be converted to a TrueFreeForm type.
 
IMessage RunTool_ConvertSurfaceToFreeform (int fromSurface, int freeformSurface, int gridNx, int gridNy, bool limitToClearAperture)
 Converts one sag-based surface into a TrueFreeForm surface on another row.
 
IMessage RunTool_ConvertSurfaceInPlaceToFreeform (int fromSurface, int gridNx, int gridNy, bool limitToClearAperture)
 Converts one sag-based surface into a TrueFreeForm surface on the same row.
 
bool CanExportPointCloud (int Surface)
 Checks if surface can be exported to a point cloud file.
 
IMessage RunTool_ExportPointCloudFile (int Surface, string filename, int gridNx, int gridNy, bool includeSurfaceNormals, PointCloudFileFormat format)
 For supported surfaces, exports to a point cloud file.
 
string GetClosestGlass (int Surface)
 Get the closest catalog glass to the model glass on the specified surface. Note that this should only be called for a surface that uses a model glass solve, otherwise the result is undefined.
 
long GetId (int surface)
 Get the unique identifier for the given surface.
 
ILDETool_TiltDecenterElements GetTool_TiltDecenterElements ()
 Gets the settings for the Tilt/Decenter Element tool.
 
IMessage RunTool_TiltDecenterElements (ILDETool_TiltDecenterElements settings)
 Runs the Tilt/Decenter Element tool with the specified settings (GetTool_TiltDecenterElements).
 
- 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 RowToSurfaceOffset [get]
 Gets the offset from a row to a surface. Note that unlike all other editors, this is 0.
 
int NumberOfSurfaces [get]
 Gets the number of surfaces in the current system.
 
int NumberOfNonSequentialSurfaces [get]
 Gets the number of surfaces in the current system.
 
SurfaceColumn FirstColumn [get]
 Gets the first available column.
 
SurfaceColumn LastColumn [get]
 Gets the last available column.
 
int StopSurface [get]
 Gets the number of the stop surface.
 
- 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 Lens Data Editor. This interface can be accessed via the IOpticalSystem interface.

Usage (see Example 15 for a full sample)

C#

// remove all variables and add a F# solve on last surface radius
ILensDataEditor TheLDE = TheSystem.LDE;
IOpticalSystemTools tools = TheSystem.Tools;
tools.RemoveAllVariables();
ILDERow Surface_Last = TheLDE.GetSurfaceAt(TheLDE.NumberOfSurfaces - 2);
ISolveData Solver = Surface_Last.RadiusCell.CreateSolveType(ZOSAPI.Editors.SolveType.FNumber);
Solver._S_FNumber.FNumber = 3.1415;
Surface_Last.RadiusCell.SetSolveData(Solver);
SampleFile = System.IO.Path.Combine(TheApplication.SamplesDir, @"API\CS\e15_Seq_Optimization\OptimizedFile1.zos");
TheSystem.SaveAs(SampleFile);
SolveStatus SetSolveData(ISolveData Data)
Updates the system with the new solve type settings (see also CreateSolveType and GetSolveData).
ISolveData CreateSolveType(SolveType type)
Creates the solve type settings for the specified solve type. Note that SetSolveData must be used to ...
Base interface for all solve types. This interface can be accesed via the IEditorCell interface....
Definition: InterfacesEditors.cs:563
All data for a Lens Data Editor surface. This interface can be accessed via the ILensDataEditor inter...
Definition: InterfacesLDE.cs:791
IEditorCell RadiusCell
Definition: InterfacesLDE.cs:990
This interface defines all properties and methods needed to interact with the Lens Data Editor....
Definition: InterfacesLDE.cs:265
ILDERow GetSurfaceAt(int SurfaceNumber)
Gets the data for the specified surface.
int NumberOfSurfaces
Gets the number of surfaces in the current system.
Definition: InterfacesLDE.cs:292
Definition: InterfacesEditors.cs:12
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5

C++

// remove all variables and add a F# solve on last surface radius
ILensDataEditorPtr TheLDE = TheSystem->LDE;
//IOpticalSystemTools
IOpticalSystemToolsPtr tools = TheSystem->Tools;
tools->RemoveAllVariables();
ILDERowPtr Surface_Last = TheLDE->GetSurfaceAt(TheLDE->NumberOfSurfaces - 2);
ISolveDataPtr Solver = Surface_Last->RadiusCell->CreateSolveType(SolveType::SolveType_FNumber);
Solver->_S_FNumber->FNumber = 3.1415;
Surface_Last->RadiusCell->SetSolveData(Solver);
SampleFile = _bstr_t(TheApplication->SamplesDir) + "\\API\\\Seq_Optimization\\\OptimizedFile1.zos";
TheSystem->SaveAs(SampleFile);

Matlab

% remove all variables and add a F# solve on last surface radius
TheLDE = TheSystem.LDE;
tools = TheSystem.Tools;
tools.RemoveAllVariables();
Surface_Last = TheLDE.GetSurfaceAt(TheLDE.NumberOfSurfaces - 2);
Solver = Surface_Last.RadiusCell.CreateSolveType(ZOSAPI.Editors.SolveType.FNumber);
Solver.S_FNumber_.FNumber = 3.1415;
Surface_Last.RadiusCell.SetSolveData(Solver);
SampleFile = System.String.Concat(TheApplication.SamplesDir, '\API\Matlab\e15_Seq_Optimization\OptimizedFile1.zos');
TheSystem.SaveAs(SampleFile);

Python

# remove all variables and add a F# solve on last surface radius
TheLDE = TheSystem.LDE
#IOpticalSystemTools
tools = TheSystem.Tools
tools.RemoveAllVariables()
Surface_Last = TheLDE.GetSurfaceAt(TheLDE.NumberOfSurfaces - 2)
Solver = Surface_Last.RadiusCell.CreateSolveType(ZOSAPI.Editors.SolveType.FNumber)
Solver._S_FNumber.FNumber = 3.1415
Surface_Last.RadiusCell.SetSolveData(Solver)
SampleFile = TheApplication.SamplesDir + '\\API\\Python\\e15_Seq_Optimization\\OptimizedFile1.zos'
TheSystem.SaveAs(SampleFile)
Examples
CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_15_Seq_Optimization.cs, and CSharpStandalone_19_Surface_Properties.cs.

Member Function Documentation

◆ AddSurface()

ILDERow ZOSAPI.Editors.LDE.ILensDataEditor.AddSurface ( )

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

Returns

◆ CanConvertSurfaceToFreeform()

bool ZOSAPI.Editors.LDE.ILensDataEditor.CanConvertSurfaceToFreeform ( int  fromSurface)

Checks if surface can be converted to a TrueFreeForm type.

Parameters
fromSurfaceThe surface you want to check for compatibility with a TrueFreeForm representation.
Returns
True if surface can be converted, False otherwise.

◆ CanExportPointCloud()

bool ZOSAPI.Editors.LDE.ILensDataEditor.CanExportPointCloud ( int  Surface)

Checks if surface can be exported to a point cloud file.

Parameters
SurfaceThe surface you want to check for point cloud export.
Returns
True if surface can be exported, False otherwise.

◆ CopySurfaces()

int ZOSAPI.Editors.LDE.ILensDataEditor.CopySurfaces ( int  fromSurfaceNumber,
int  NumberOfSurfaces,
int  toSurfaceNumber 
)

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

Usage (see Example 19 for a full sample)

C#

// Copy 3 surfaces starting from surface number 2 in LDE and paste to surface number 5,
// which will become surface number 8 after pasting.
for (int i = 0; i < 10; i++)
{
TheLDE.CopySurfaces(2, 3, 5);
}
// Save file
TheSystem.SaveAs(TheApplication.SamplesDir + "\\API\\CS\\e19_Sample_Prism_Chain.zos");

C++

// Copy 3 surfaces starting from surface number 2 in LDE and paste to surface number 5,
// which will become surface number 8 after pasting.
for (int i = 0; i < 10; i++) {
TheLDE->CopySurfaces(2, 3, 5);
}
// Save file
TheSystem->SaveAs(TheApplication->SamplesDir + "\\API\\CPP\\e19_Sample_Prism_Chain.zos");

Matlab

% Copy 3 surfaces starting from surface number 2 in LDE and paste to surface number 5, which will become surface number 8 after pasting.
for i =1:10
TheLDE.CopySurfaces(2, 3, 5);
end
% Save file
TheSystem.SaveAs(System.String.Concat(TheApplication.SamplesDir, '\API\Matlab\e19_Sample_Prism_Chain.zos'));
@ LDE
Lens Data Editor.

Python

# Copy 3 surfaces starting from surface number 2 in LDE and paste to surface number 5, which will become surface number 8 after pasting.
for i in range(10):
TheLDE.CopySurfaces(2, 3, 5)
# Save file
TheSystem.SaveAs(TheApplication.SamplesDir + '\\API\\Python\\e19_Sample_Prism_Chain.zos')
Parameters
fromSurfaceNumberFirst surface number to copy (1 to NumberOfSurfaces).
NumberOfSurfacesThe number of surfaces to copy.
toSurfaceNumberRow to start inserting the surfaces (1 to NumberOfSurfaces+1).
Returns
The number of surfaces actually copied.
Examples
CSharpStandalone_19_Surface_Properties.cs.

◆ CopySurfacesFrom()

int ZOSAPI.Editors.LDE.ILensDataEditor.CopySurfacesFrom ( ILensDataEditor  fromEditor,
int  fromSurfaceNumber,
int  NumberOfSurfaces,
int  toSurfaceNumber 
)

Copy and paste the specified number of surfaces 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 surfaces from.
fromSurfaceNumberFirst surface number to copy (1 to NumberOfSurfaces).
NumberOfSurfacesThe number of surfaces to copy.
toSurfaceNumberTo surface number (1 to NumberOfSurfaces+1).
Returns
The number of surfaces actually copied.

◆ FindLabel()

bool ZOSAPI.Editors.LDE.ILensDataEditor.FindLabel ( int  label,
out int  Surface 
)

Finds the surface associated with the specified integer label.

Parameters
labelThe label number to find.
SurfaceThe first surface found with a matching label.
Returns
True if the label was found; False otherwise.

◆ GetApodization()

double ZOSAPI.Editors.LDE.ILensDataEditor.GetApodization ( double  px,
double  py 
)

This item computes the intensity apodization of a ray from the apodization type and value.

Parameters
pxnormalized pupil coordinates - x
pynormalized pupil coordinates - y
Returns
intensity apodization

◆ GetClosestGlass()

string ZOSAPI.Editors.LDE.ILensDataEditor.GetClosestGlass ( int  Surface)

Get the closest catalog glass to the model glass on the specified surface. Note that this should only be called for a surface that uses a model glass solve, otherwise the result is undefined.

Parameters
SurfaceDesired surface (0 to NumberOfSurfaces)
Returns
The glass name if found, otherwise an empty string

◆ GetFirstOrderData()

void ZOSAPI.Editors.LDE.ILensDataEditor.GetFirstOrderData ( out double  EFL,
out double  paraxialWorkingFNumber,
out double  realWorkingFNumber,
out double  paraxialImageHeight,
out double  paraxialMagnification 
)

This item extracts first order data about the lens.

Parameters
EFLEstimated focal length
paraxialWorkingFNumberParaxial working f#
realWorkingFNumberReal working f#
paraxialImageHeightParaxial image height
paraxialMagnificationParaxial magnification

◆ GetGlass()

bool ZOSAPI.Editors.LDE.ILensDataEditor.GetGlass ( int  Surface,
out string  glassName,
out double  nd,
out double  vd,
out double  dpgf 
)

Retrieve data about the glass on any surface.

Parameters
SurfaceSurface # (0-based)
glassNameThe name of the glass
ndThe nd value
vdThe vd value
dpgfThe dpgf value
Returns
false if the surface is not valid, is not made of glass, or is a gradient index; otherwise, true.

◆ GetGlobalMatrix()

bool ZOSAPI.Editors.LDE.ILensDataEditor.GetGlobalMatrix ( int  Surface,
out double  R11,
out double  R12,
out double  R13,
out double  R21,
out double  R22,
out double  R23,
out double  R31,
out double  R32,
out double  R33,
out double  Xo,
out double  Yo,
out double  Zo 
)

Get the matrix required to convert any local coordinates (such as from a ray trace) into global coordinates.

Parameters
SurfaceSurface # (0-based)
R11Row 1, Column 1
R12Row 1, Column 2
R13Row 1, Column 3
R21Row 2, Column 1
R22Row 2, Column 2
R23Row 2, Column 3
R31Row 3, Column 1
R32Row 3, Column 2
R33Row 3, Column 3
XoX offset
YoY offset
ZoZ offset
Returns
True for a valid surface; False otherwise

◆ GetId()

long ZOSAPI.Editors.LDE.ILensDataEditor.GetId ( int  surface)

Get the unique identifier for the given surface.

Parameters
surfaceA surface number
Returns
The identifier of the surface.

◆ GetIndex()

int ZOSAPI.Editors.LDE.ILensDataEditor.GetIndex ( int  Surface,
int  NumberOfWavelengths,
[In, Out] double[]  indexAtWavelength 
)

Extract refraction data for any surface.

Parameters
SurfaceSurface # (0-based)
NumberOfWavelengthsThe number of wavelenghts to retrieve. Note: this number must be the length of indexAtWavelength.
indexAtWavelengthWhen the function returns, this will hold the index at each system wavelength. Note: only data for the minimum of 'NumberOfWavelengths' and the number of system wavelengths will be populated.
Returns
The count of index data successfully read.

◆ GetLabel()

bool ZOSAPI.Editors.LDE.ILensDataEditor.GetLabel ( int  Surface,
out int  label 
)

Gets the integer label associated with the specified surface.

Parameters
SurfaceSurface # (0-based)
labelThe label number for the surface.
Returns
True if the surface is valid; false otherwise.

◆ GetPupil()

void ZOSAPI.Editors.LDE.ILensDataEditor.GetPupil ( out ZemaxApertureType  type,
out double  ApertureValue,
out double  entrancePupilDiameter,
out double  entrancePupilPosition,
out double  exitPupilDiameter,
out double  exitPupilPosition,
out PupilApodizationType  ApodizationType,
out double  ApodizationFactor 
)

Retrieve pupil data.

Parameters
typeSystem aperture type.
ApertureValueIf type=ZemaxApertureType.FloatByStopSize then stop surface semi-diameter, else aperture value.
entrancePupilDiameterThe entrance pupil diameter.
entrancePupilPositionThe entrance pupil position.
exitPupilDiameterThe exit pupil diameter.
exitPupilPositionThe exit pupil position.
ApodizationTypeThe type of apodization.
ApodizationFactorThe apodization factor.

◆ GetSag()

bool ZOSAPI.Editors.LDE.ILensDataEditor.GetSag ( int  Surface,
double  X,
double  Y,
out double  sag,
out double  alternateSag 
)

Gets the sag values(s) for the specified surface, in lens units.

Parameters
SurfaceSurface # (0-based). A value of -1 will return data for the Image surface.
XX coordinate on the surface, in lens units.
YY coordinate on the surface, in lens units.
sagThe sag value.
alternateSagThe alternate sag value (if applicable).
Returns
True if the surface is valid; False otherwise.

◆ GetSurfaceAt()

ILDERow ZOSAPI.Editors.LDE.ILensDataEditor.GetSurfaceAt ( int  SurfaceNumber)

Gets the data for the specified surface.

Usage (see Example 15 for a full sample)

C#

//setup a few variables
tools.SetAllRadiiVariable();
ILDERow Surface1 = TheLDE.GetSurfaceAt(1);
ILDERow Surface2 = TheLDE.GetSurfaceAt(2);
ILDERow Surface5 = TheLDE.GetSurfaceAt(5);
ILDERow Surface6 = TheLDE.GetSurfaceAt(6);
ILDERow Surface9 = TheLDE.GetSurfaceAt(9);
ILDERow Surface10 = TheLDE.GetSurfaceAt(10);
ILDERow Surface11 = TheLDE.GetSurfaceAt(11);

C++

// setup a few variables
tools->SetAllRadiiVariable();
ILDERowPtr Surface1 = TheLDE->GetSurfaceAt(1);
ILDERowPtr Surface2 = TheLDE->GetSurfaceAt(2);
ILDERowPtr Surface5 = TheLDE->GetSurfaceAt(5);
ILDERowPtr Surface6 = TheLDE->GetSurfaceAt(6);
ILDERowPtr Surface9 = TheLDE->GetSurfaceAt(9);
ILDERowPtr Surface10 = TheLDE->GetSurfaceAt(10);
ILDERowPtr Surface11 = TheLDE->GetSurfaceAt(11);

Matlab

%setup a few variables
tools.SetAllRadiiVariable();
Surface1 = TheLDE.GetSurfaceAt(1);
Surface2 = TheLDE.GetSurfaceAt(2);
Surface5 = TheLDE.GetSurfaceAt(5);
Surface6 = TheLDE.GetSurfaceAt(6);
Surface9 = TheLDE.GetSurfaceAt(9);
Surface10 = TheLDE.GetSurfaceAt(10);
Surface11 = TheLDE.GetSurfaceAt(11);

Python

# setup a few variables
tools.SetAllRadiiVariable()
Surface1 = TheLDE.GetSurfaceAt(1)
Surface2 = TheLDE.GetSurfaceAt(2)
Surface5 = TheLDE.GetSurfaceAt(5)
Surface6 = TheLDE.GetSurfaceAt(6)
Surface9 = TheLDE.GetSurfaceAt(9)
Surface10 = TheLDE.GetSurfaceAt(10)
Surface11 = TheLDE.GetSurfaceAt(11)
Parameters
SurfaceNumberThe surface number (0 to NumberOfSurfaces-1).
Returns
Examples
CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_15_Seq_Optimization.cs, and CSharpStandalone_19_Surface_Properties.cs.

◆ GetTool_AddCoatingsToAllSurfaces()

ILDETool_AddCoatingsToAllSurfaces ZOSAPI.Editors.LDE.ILensDataEditor.GetTool_AddCoatingsToAllSurfaces ( )

Gets the settings for the Add Coatings to All Surfaces tool.

Returns

◆ GetTool_TiltDecenterElements()

ILDETool_TiltDecenterElements ZOSAPI.Editors.LDE.ILensDataEditor.GetTool_TiltDecenterElements ( )

Gets the settings for the Tilt/Decenter Element tool.

◆ HideLDE()

void ZOSAPI.Editors.LDE.ILensDataEditor.HideLDE ( )

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

Returns

◆ InsertNewSurfaceAt()

ILDERow ZOSAPI.Editors.LDE.ILensDataEditor.InsertNewSurfaceAt ( int  SurfaceNumber)

Inserts a new surface at the specified position.

Usage (see Example 19 for a full sample)

C#

// Get interface of Lens Data Editor and add 3 surfaces.
ILensDataEditor TheLDE = TheSystem.LDE;
TheLDE.InsertNewSurfaceAt(2);
TheLDE.InsertNewSurfaceAt(2);
TheLDE.InsertNewSurfaceAt(2);
// Set thickness and material for each surface.
TheLDE.GetSurfaceAt(1).Thickness = 30;
TheLDE.GetSurfaceAt(2).Thickness = 20;
TheLDE.GetSurfaceAt(4).Thickness = 30;
TheLDE.GetSurfaceAt(2).Material = "N-BK7";
double Thickness
Gets or sets the surface thickness.
Definition: InterfacesLDE.cs:1009
string Material
Definition: InterfacesLDE.cs:1023
ILDERow InsertNewSurfaceAt(int SurfaceNumber)
Inserts a new surface at the specified position.

C++

// Get interface of Lens Data Editor and add 3 surfaces.
ILensDataEditorPtr TheLDE = TheSystem->LDE;
TheLDE->InsertNewSurfaceAt(2);
TheLDE->InsertNewSurfaceAt(2);
TheLDE->InsertNewSurfaceAt(2);
// Set thickness and material for each surface.
TheLDE->GetSurfaceAt(1)->Thickness = 30;
TheLDE->GetSurfaceAt(2)->Thickness = 20;
TheLDE->GetSurfaceAt(4)->Thickness = 30;
TheLDE->GetSurfaceAt(2)->Material = "N-BK7";

Matlab

% Get interface of Lens Data Editor and add 3 surfaces.
TheLDE = TheSystem.LDE;
TheLDE.InsertNewSurfaceAt(2);
TheLDE.InsertNewSurfaceAt(2);
TheLDE.InsertNewSurfaceAt(2);
% Set thickness and material for each surface.
TheLDE.GetSurfaceAt(1).Thickness = 30;
TheLDE.GetSurfaceAt(2).Thickness = 20;
TheLDE.GetSurfaceAt(4).Thickness = 30;
TheLDE.GetSurfaceAt(2).Material = 'N-BK7';

Python

# Get interface of Lens Data Editor and add 3 surfaces.
TheLDE = TheSystem.LDE
TheLDE.InsertNewSurfaceAt(2)
TheLDE.InsertNewSurfaceAt(2)
TheLDE.InsertNewSurfaceAt(2)
# Set thickness and material for each surface.
TheLDE.GetSurfaceAt(1).Thickness = 30
TheLDE.GetSurfaceAt(2).Thickness = 20
TheLDE.GetSurfaceAt(4).Thickness = 30
TheLDE.GetSurfaceAt(2).Material = 'N-BK7'
Parameters
SurfaceNumberThe surface number (1 to NumberOfSurfaces).
Returns
Examples
CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_11_Basic_Seq.cs, and CSharpStandalone_19_Surface_Properties.cs.

◆ RemoveSurfaceAt()

bool ZOSAPI.Editors.LDE.ILensDataEditor.RemoveSurfaceAt ( int  SurfaceNumber)

Removes the surface at the specified location.

Parameters
SurfaceNumberThe surface number to remove (1 to NumberOfSurfaces-1).
Returns
true if the surface was successfully remove; otherwise, false.

◆ RemoveSurfacesAt()

int ZOSAPI.Editors.LDE.ILensDataEditor.RemoveSurfacesAt ( int  SurfaceNumber,
int  numSurfaces 
)

Removes one or more surfaces at the specified location.

Parameters
SurfaceNumberThe surface number to remove (1 to NumberOfSurfaces-1).
numSurfacesThe number surfaces to remove.
Returns
The number of surfaces actually removed.

◆ RunTool_AddCoatingsToAllSurfaces()

void ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_AddCoatingsToAllSurfaces ( ILDETool_AddCoatingsToAllSurfaces  settings)

Runs the Add Coatings to All Surfaces tool with the specified settings (GetTool_AddCoatingsToAllSurfaces).

Parameters
settingsThe settings.

◆ RunTool_AddFoldMirror()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_AddFoldMirror ( int  Surface,
TiltType  tilt,
double  reflectAngle 
)

Make the specified surface a fold mirror and inserts the required coordinate breaks to bend a beam.

Parameters
SurfaceSelects which surface will become the fold mirror (0-based). The selected surface should be a dummy surface already located at the desired fold position.
tiltSelect either tilt about the local x or y axis.
reflectAngleThe angle between the incident and reflected beam.
Returns
null on success; an IMessage otherwise

◆ RunTool_ConvertGlobalToLocalCoordinates()

CoordinateConversionResult ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ConvertGlobalToLocalCoordinates ( int  FirstSurface,
int  LastSurface,
ConversionOrder  order 
)

Converts Global to Local coordinates.

Usage (see Example 19 for a full sample)

C#

// Run tool Convert Local To Global Coordinates to convert surface #2 to surface #35 to be globally referenced to surface #1
TheLDE.RunTool_ConvertLocalToGlobalCoordinates(2, 35, 1);
TheSystem.SaveAs(TheApplication.SamplesDir + "\\API\\CS\\e19_Sample_Prism_Chain_GlobalCoordinate.zos");

C++

// Run tool Convert Local To Global Coordinates to convert surface #2 to surface #35 to be globally referenced to surface #1
TheLDE->RunTool_ConvertLocalToGlobalCoordinates(2, 35, 1);
TheSystem->SaveAs(TheApplication->SamplesDir + "\\API\\CPP\\e19_Sample_Prism_Chain_GlobalCoordinate.zos");

Matlab

% Run tool Convert Local To Global Coordinates to convert surface #2 to surface #35 to be globally referenced to surface #1
TheLDE.RunTool_ConvertLocalToGlobalCoordinates(2, 35, 1);
TheSystem.SaveAs(System.String.Concat(TheApplication.SamplesDir, '\API\Matlab\e19_Sample_Prism_Chain_GlobalCoordinate.zos'));

Python

# Run tool Convert Local To Global Coordinates to convert surface #2 to surface #35 to be globally referenced to surface #1
TheLDE.RunTool_ConvertLocalToGlobalCoordinates(2, 35, 1)
TheSystem.SaveAs(TheApplication.SamplesDir + '\\API\\Python\\e19_Sample_Prism_Chain_GlobalCoordinate.zos')
Parameters
FirstSurfaceThe first surface.
LastSurfaceThe last surface.
orderThe order.
Returns
Examples
CSharpStandalone_19_Surface_Properties.cs.

◆ RunTool_ConvertLocalToGlobalCoordinates()

CoordinateConversionResult ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ConvertLocalToGlobalCoordinates ( int  FirstSurface,
int  LastSurface,
int  referenceSurface 
)

Converts Local to Global coordinates.

Usage (see Example 19 for a full sample)

C#

// Run tool Convert Local To Global Coordinates to convert surface #2 to surface #35 to be globally referenced to surface #1
TheLDE.RunTool_ConvertLocalToGlobalCoordinates(2, 35, 1);
TheSystem.SaveAs(TheApplication.SamplesDir + "\\API\\CS\\e19_Sample_Prism_Chain_GlobalCoordinate.zos");

C++

// Run tool Convert Local To Global Coordinates to convert surface #2 to surface #35 to be globally referenced to surface #1
TheLDE->RunTool_ConvertLocalToGlobalCoordinates(2, 35, 1);
TheSystem->SaveAs(TheApplication->SamplesDir + "\\API\\CPP\\e19_Sample_Prism_Chain_GlobalCoordinate.zos");

Matlab

% Run tool Convert Local To Global Coordinates to convert surface #2 to surface #35 to be globally referenced to surface #1
TheLDE.RunTool_ConvertLocalToGlobalCoordinates(2, 35, 1);
TheSystem.SaveAs(System.String.Concat(TheApplication.SamplesDir, '\API\Matlab\e19_Sample_Prism_Chain_GlobalCoordinate.zos'));

Python

# Run tool Convert Local To Global Coordinates to convert surface #2 to surface #35 to be globally referenced to surface #1
TheLDE.RunTool_ConvertLocalToGlobalCoordinates(2, 35, 1)
TheSystem.SaveAs(TheApplication.SamplesDir + '\\API\\Python\\e19_Sample_Prism_Chain_GlobalCoordinate.zos')
Parameters
FirstSurfaceThe first surface.
LastSurfaceThe last surface.
referenceSurfaceThe reference surface.
Returns
Examples
CSharpStandalone_19_Surface_Properties.cs.

◆ RunTool_ConvertSemiDiametersToCircularApertures()

void ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ConvertSemiDiametersToCircularApertures ( )

Convert Semi-Diameters to Circular Apertures.

◆ RunTool_ConvertSemiDiametersToFloatingApertures()

void ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ConvertSemiDiametersToFloatingApertures ( )

Convert Semi-Diameters to Floating Apertures.

◆ RunTool_ConvertSemiDiametersToMaximumApertures()

void ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ConvertSemiDiametersToMaximumApertures ( )

Convert Semi-Diameters to Maximum Apertures.

◆ RunTool_ConvertSurfaceInPlaceToFreeform()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ConvertSurfaceInPlaceToFreeform ( int  fromSurface,
int  gridNx,
int  gridNy,
bool  limitToClearAperture 
)

Converts one sag-based surface into a TrueFreeForm surface on the same row.

Parameters
fromSurfaceThe sag-based surface you want to convert to a TrueFreeForm representation.
gridNxThe number of grid points in the x-direction.
gridNyThe number of grid points in the y-direction.

///

Parameters
limitToClearApertureIf true, limit the grid sampling to the clear aperture of the original surface.
Returns
null on success; an IMessage otherwise

◆ RunTool_ConvertSurfaceToFreeform()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ConvertSurfaceToFreeform ( int  fromSurface,
int  freeformSurface,
int  gridNx,
int  gridNy,
bool  limitToClearAperture 
)

Converts one sag-based surface into a TrueFreeForm surface on another row.

Parameters
fromSurfaceThe sag-based surface you want to convert to a TrueFreeForm representation.
freeformSurfaceThe index of the TrueFreeForm surface.
gridNxThe number of grid points in the x-direction.
gridNyThe number of grid points in the y-direction.
limitToClearApertureIf true, limit the grid sampling to the clear aperture of the original surface.
Returns
null on success; an IMessage otherwise

◆ RunTool_DeleteFoldMirror()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_DeleteFoldMirror ( int  foldSurface)

Deletes an existing fold mirror, including any neighboring coordinate breaks.

Parameters
foldSurfaceSelects which mirror surface will be deleted (0-based).
Returns
null on success; an IMessage otherwise

◆ RunTool_ExportPointCloudFile()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ExportPointCloudFile ( int  Surface,
string  filename,
int  gridNx,
int  gridNy,
bool  includeSurfaceNormals,
PointCloudFileFormat  format 
)

For supported surfaces, exports to a point cloud file.

Parameters
SurfaceThe sag-based surface you want to convert to a freeform representation.


Parameters
filenameThe filename for the point cloud data file.


Parameters
gridNxThe number of sample points in the x-direction.
gridNyThe number of sample points in the y-direction.
includeSurfaceNormalsWhether to include surface normal information in the file.
formatWhat format to use for the file, choices are ASCII, Binary, and CompressedBinary.
Returns
null on success; an IMessage otherwise

◆ RunTool_MakeDoublePass()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_MakeDoublePass ( int  reflectAtSurface)

Create a second pass through the specified surfaces that represents a reflection propagating back through the optical system.

Parameters
reflectAtSurfaceThe surface at which to insert a mirror and create the reflected system (0-based).
Returns
null on success; an IMessage otherwise

◆ RunTool_MakeFocal()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_MakeFocal ( double  focalLength)

Scale the lens to the desired focal length.

Parameters
focalLengthThe desired focal length.
Returns
null on success; an IMessage otherwise

◆ RunTool_RemoveAllApertures()

void ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_RemoveAllApertures ( )

Remove All Apertures.

◆ RunTool_ReplaceVignettingWithApertures()

void ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ReplaceVignettingWithApertures ( )

Replace Vignetting with Apertures.

◆ RunTool_ReverseElements()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_ReverseElements ( int  firstSurface,
int  lastSurface 
)

Reverses a lens element or group.

Parameters
firstSurfaceThe first surface of the lens group to be reversed (0-based).
lastSurfaceThe last surface of the lens group to be reversed (0-based).
Returns
null on success; an IMessage otherwise

◆ RunTool_TiltDecenterElements()

IMessage ZOSAPI.Editors.LDE.ILensDataEditor.RunTool_TiltDecenterElements ( ILDETool_TiltDecenterElements  settings)

Runs the Tilt/Decenter Element tool with the specified settings (GetTool_TiltDecenterElements).

Parameters
settingsThe settings.
Returns
Error message if any occurs.

◆ SetLabel()

bool ZOSAPI.Editors.LDE.ILensDataEditor.SetLabel ( int  Surface,
int  label 
)

Sets the integer label associated with the specified surface.

Parameters
SurfaceSurface # (0-based)
labelThe new label number for the surface.
Returns
True if the surface is valid; false otherwise.

◆ ShowLDE()

bool ZOSAPI.Editors.LDE.ILensDataEditor.ShowLDE ( )

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

SurfaceColumn ZOSAPI.Editors.LDE.ILensDataEditor.FirstColumn
get

Gets the first available column.

The first column.

◆ LastColumn

SurfaceColumn ZOSAPI.Editors.LDE.ILensDataEditor.LastColumn
get

Gets the last available column.

The last column.

◆ NumberOfNonSequentialSurfaces

int ZOSAPI.Editors.LDE.ILensDataEditor.NumberOfNonSequentialSurfaces
get

Gets the number of surfaces in the current system.

The number of surfaces.

◆ NumberOfSurfaces

int ZOSAPI.Editors.LDE.ILensDataEditor.NumberOfSurfaces
get

Gets the number of surfaces in the current system.

Usage (see Example 22 for a full sample)

C#

// Set up Batch Ray Trace
ZOSAPI.Tools.RayTrace.IBatchRayTrace raytrace = TheSystem.Tools.OpenBatchRayTrace();
int nsur = TheSystem.LDE.NumberOfSurfaces;
int max_rays = 30;
ZOSAPI.Tools.RayTrace.IRayTraceNormUnpolData normUnPolData = raytrace.CreateNormUnpol((max_rays + 1) * (max_rays + 1), ZOSAPI.Tools.RayTrace.RaysType.Real, nsur);
Interfaces and methods for running a ray trace on multiple rays at a time. This interface can be acce...
Definition: RayTrace.cs:239
IRayTraceNormUnpolData CreateNormUnpol(int MaxRays, RaysType rayType, int toSurface)
Performs a batch unpolarized ray trace, using normalized pupil coordinates. See the OpticStudio help ...
Definition: RayTrace.cs:12
Definition: FileSource.cs:4

C++

// Set up Batch Ray Trace
IBatchRayTracePtr raytrace = TheSystem->Tools->OpenBatchRayTrace();
int nsur = TheSystem->LDE->NumberOfSurfaces;
int max_rays = 30;
IRayTraceNormUnpolDataPtr normUnPolData = raytrace->CreateNormUnpol((max_rays + 1) * (max_rays + 1), RaysType::RaysType_Real, nsur);

Matlab

% Set up Batch Ray Trace
raytrace = TheSystem.Tools.OpenBatchRayTrace();
nsur = TheSystem.LDE.NumberOfSurfaces;
max_rays = 30;
normUnPolData = raytrace.CreateNormUnpol((max_rays + 1) * (max_rays + 1),ZOSAPI.Tools.RayTrace.RaysType.Real,nsur);

Python

# Set up Batch Ray Trace
raytrace = TheSystem.Tools.OpenBatchRayTrace()
nsur = TheSystem.LDE.NumberOfSurfaces
max_rays = 30
normUnPolData = raytrace.CreateNormUnpol((max_rays + 1) * (max_rays + 1), ZOSAPI.Tools.RayTrace.RaysType.Real, nsur)

The number of surfaces.

Examples
CSharpStandalone_15_Seq_Optimization.cs.

◆ RowToSurfaceOffset

int ZOSAPI.Editors.LDE.ILensDataEditor.RowToSurfaceOffset
get

Gets the offset from a row to a surface. Note that unlike all other editors, this is 0.

The row to surface offset.

◆ StopSurface

int ZOSAPI.Editors.LDE.ILensDataEditor.StopSurface
get

Gets the number of the stop surface.

The stop surface.

Connect with Ansys