Skip to main content

Zemax OpticStudio ZOS-API 2026 R1

Interface ZOSAPI::Editors::LDE::ILensDataEditor

Last update: 13.03.2026

Definition:

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

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)

Inherits from:

Members

Properties

Property RowToSurfaceOffset

Definition:

int ZOSAPI.Editors.LDE.ILensDataEditor.RowToSurfaceOffset

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

The row to surface offset.

Return type: int

Property NumberOfSurfaces

Definition:

int ZOSAPI.Editors.LDE.ILensDataEditor.NumberOfSurfaces

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

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.

Return type: int

Property NumberOfNonSequentialSurfaces

Definition:

int ZOSAPI.Editors.LDE.ILensDataEditor.NumberOfNonSequentialSurfaces

Gets the number of surfaces in the current system.

The number of surfaces.

Return type: int

Property FirstColumn

Definition:

SurfaceColumn ZOSAPI.Editors.LDE.ILensDataEditor.FirstColumn

Gets the first available column.

The first column.

Return type: SurfaceColumn

Property LastColumn

Definition:

SurfaceColumn ZOSAPI.Editors.LDE.ILensDataEditor.LastColumn

Gets the last available column.

The last column.

Return type: SurfaceColumn

Property StopSurface

Definition:

int ZOSAPI.Editors.LDE.ILensDataEditor.StopSurface

Gets the number of the stop surface.

The stop surface.

Return type: int

Public functions

Function 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:

  • SurfaceNumber: The surface number (0 to NumberOfSurfaces-1).

Returns:

Parameters:

  • int SurfaceNumber

Return type: ILDERow

Function 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";

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:

  • SurfaceNumber: The surface number (1 to NumberOfSurfaces).

Returns:

Parameters:

  • int SurfaceNumber

Return type: ILDERow

Function AddSurface

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

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

Returns:

Return type: ILDERow

Function RemoveSurfaceAt

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

Removes the surface at the specified location.

Parameters:

  • SurfaceNumber: The surface number to remove (1 to NumberOfSurfaces-1).

Returns:

true if the surface was successfully remove; otherwise, false.

Parameters:

  • int SurfaceNumber

Return type: bool

Function RemoveSurfacesAt

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

Removes one or more surfaces at the specified location.

Parameters:

  • SurfaceNumber: The surface number to remove (1 to NumberOfSurfaces-1).
  • numSurfaces: The number surfaces to remove.

Returns:

The number of surfaces actually removed.

Parameters:

  • int SurfaceNumber
  • int numSurfaces

Return type: int

Function 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:

Return type: bool

Function 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:

Return type: void

Function GetTool_AddCoatingsToAllSurfaces

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

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

Returns:

Return type: ILDETool_AddCoatingsToAllSurfaces

Function 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:

  • settings: The settings.

Parameters:

Return type: void

Function RunTool_RemoveAllApertures

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

Remove All Apertures.

Return type: void

Function RunTool_ConvertSemiDiametersToCircularApertures

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

Convert Semi-Diameters to Circular Apertures.

Return type: void

Function RunTool_ConvertSemiDiametersToFloatingApertures

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

Convert Semi-Diameters to Floating Apertures.

Return type: void

Function RunTool_ConvertSemiDiametersToMaximumApertures

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

Convert Semi-Diameters to Maximum Apertures.

Return type: void

Function RunTool_ReplaceVignettingWithApertures

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

Replace Vignetting with Apertures.

Return type: void

Function 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:

  • FirstSurface: The first surface.
  • LastSurface: The last surface.
  • order: The order.

Returns:

Parameters:

Return type: CoordinateConversionResult

Function 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:

  • FirstSurface: The first surface.
  • LastSurface: The last surface.
  • referenceSurface: The reference surface.

Returns:

Parameters:

  • int FirstSurface
  • int LastSurface
  • int referenceSurface

Return type: CoordinateConversionResult

Function 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:

  • px: normalized pupil coordinates - x
  • py: normalized pupil coordinates - y

Returns:

intensity apodization

Parameters:

  • double px
  • double py

Return type: double

Function 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:

  • EFL: Estimated focal length
  • paraxialWorkingFNumber: Paraxial working f#
  • realWorkingFNumber: Real working f#
  • paraxialImageHeight: Paraxial image height
  • paraxialMagnification: Paraxial magnification

Parameters:

  • out double EFL
  • out double paraxialWorkingFNumber
  • out double realWorkingFNumber
  • out double paraxialImageHeight
  • out double paraxialMagnification

Return type: void

Function 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:

  • Surface: Surface # (0-based)
  • glassName: The name of the glass
  • nd: The nd value
  • vd: The vd value
  • dpgf: The dpgf value

Returns:

false if the surface is not valid, is not made of glass, or is a gradient index; otherwise, true.

Parameters:

  • int Surface
  • out string glassName
  • out double nd
  • out double vd
  • out double dpgf

Return type: bool

Function 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:

  • Surface: Surface # (0-based)
  • R11: Row 1, Column 1
  • R12: Row 1, Column 2
  • R13: Row 1, Column 3
  • R21: Row 2, Column 1
  • R22: Row 2, Column 2
  • R23: Row 2, Column 3
  • R31: Row 3, Column 1
  • R32: Row 3, Column 2
  • R33: Row 3, Column 3
  • Xo: X offset
  • Yo: Y offset
  • Zo: Z offset

Returns:

True for a valid surface; False otherwise

Parameters:

  • 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

Return type: bool

Function GetIndex

int ZOSAPI.Editors.LDE.ILensDataEditor.GetIndex(int Surface, int NumberOfWavelengths, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)][In, Out]double[] indexAtWavelength)

Extract refraction data for any surface.

Parameters:

  • Surface: Surface # (0-based)
  • NumberOfWavelengths: The number of wavelenghts to retrieve. Note: this number must be the length of indexAtWavelength.
  • indexAtWavelength: When 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.

Parameters:

  • int Surface
  • int NumberOfWavelengths
  • [In, Out] double[] indexAtWavelength

Return type: int

Function SetLabel

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

Sets the integer label associated with the specified surface.

Parameters:

  • Surface: Surface # (0-based)
  • label: The new label number for the surface.

Returns:

True if the surface is valid; false otherwise.

Parameters:

  • int Surface
  • int label

Return type: bool

Function GetLabel

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

Gets the integer label associated with the specified surface.

Parameters:

  • Surface: Surface # (0-based)
  • label: The label number for the surface.

Returns:

True if the surface is valid; false otherwise.

Parameters:

  • int Surface
  • out int label

Return type: bool

Function FindLabel

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

Finds the surface associated with the specified integer label.

Parameters:

  • label: The label number to find.
  • Surface: The first surface found with a matching label.

Returns:

True if the label was found; False otherwise.

Parameters:

  • int label
  • out int Surface

Return type: bool

Function 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:

  • type: System aperture type.
  • ApertureValue: If type=ZemaxApertureType.FloatByStopSize then stop surface semi-diameter, else aperture value.
  • entrancePupilDiameter: The entrance pupil diameter.
  • entrancePupilPosition: The entrance pupil position.
  • exitPupilDiameter: The exit pupil diameter.
  • exitPupilPosition: The exit pupil position.
  • ApodizationType: The type of apodization.
  • ApodizationFactor: The apodization factor.

Parameters:

  • out ZemaxApertureType type
  • out double ApertureValue
  • out double entrancePupilDiameter
  • out double entrancePupilPosition
  • out double exitPupilDiameter
  • out double exitPupilPosition
  • out PupilApodizationType ApodizationType
  • out double ApodizationFactor

Return type: void

Function 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:

  • Surface: Surface # (0-based). A value of -1 will return data for the Image surface.
  • X: X coordinate on the surface, in lens units.
  • Y: Y coordinate on the surface, in lens units.
  • sag: The sag value.
  • alternateSag: The alternate sag value (if applicable).

Returns:

True if the surface is valid; False otherwise.

Parameters:

  • int Surface
  • double X
  • double Y
  • out double sag
  • out double alternateSag

Return type: bool

Function 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'));

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:

  • fromSurfaceNumber: First surface number to copy (1 to NumberOfSurfaces).
  • NumberOfSurfaces: The number of surfaces to copy.
  • toSurfaceNumber: Row to start inserting the surfaces (1 to NumberOfSurfaces+1).

Returns:

The number of surfaces actually copied.

Parameters:

  • int fromSurfaceNumber
  • int NumberOfSurfaces
  • int toSurfaceNumber

Return type: int

Function 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:

  • fromEditor: System to copy the surfaces from.
  • fromSurfaceNumber: First surface number to copy (1 to NumberOfSurfaces).
  • NumberOfSurfaces: The number of surfaces to copy.
  • toSurfaceNumber: To surface number (1 to NumberOfSurfaces+1).

Returns:

The number of surfaces actually copied.

Parameters:

  • ILensDataEditor fromEditor
  • int fromSurfaceNumber
  • int NumberOfSurfaces
  • int toSurfaceNumber

Return type: int

Function RunTool_ReverseElements

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

Reverses a lens element or group.

Parameters:

  • firstSurface: The first surface of the lens group to be reversed (0-based).
  • lastSurface: The last surface of the lens group to be reversed (0-based).

Returns:

null on success; an IMessage otherwise

Parameters:

  • int firstSurface
  • int lastSurface

Return type: IMessage

Function 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:

  • Surface: Selects which surface will become the fold mirror (0-based). The selected surface should be a dummy surface already located at the desired fold position.
  • tilt: Select either tilt about the local x or y axis.
  • reflectAngle: The angle between the incident and reflected beam.

Returns:

null on success; an IMessage otherwise

Parameters:

  • int Surface
  • TiltType tilt
  • double reflectAngle

Return type: IMessage

Function RunTool_DeleteFoldMirror

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

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

Parameters:

  • foldSurface: Selects which mirror surface will be deleted (0-based).

Returns:

null on success; an IMessage otherwise

Parameters:

  • int foldSurface

Return type: IMessage

Function 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:

  • reflectAtSurface: The surface at which to insert a mirror and create the reflected system (0-based).

Returns:

null on success; an IMessage otherwise

Parameters:

  • int reflectAtSurface

Return type: IMessage

Function RunTool_MakeFocal

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

Scale the lens to the desired focal length.

Parameters:

  • focalLength: The desired focal length.

Returns:

null on success; an IMessage otherwise

Parameters:

  • double focalLength

Return type: IMessage

Function CanConvertSurfaceToFreeform

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

Checks if surface can be converted to a TrueFreeForm type.

Parameters:

  • fromSurface: The surface you want to check for compatibility with a TrueFreeForm representation.

Returns:

True if surface can be converted, False otherwise.

Parameters:

  • int fromSurface

Return type: bool

Function 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:

  • fromSurface: The sag-based surface you want to convert to a TrueFreeForm representation.
  • freeformSurface: The index of the TrueFreeForm surface.
  • gridNx: The number of grid points in the x-direction.
  • gridNy: The number of grid points in the y-direction.
  • limitToClearAperture: If true, limit the grid sampling to the clear aperture of the original surface.

Returns:

null on success; an IMessage otherwise

Parameters:

  • int fromSurface
  • int freeformSurface
  • int gridNx
  • int gridNy
  • bool limitToClearAperture

Return type: IMessage

Function 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:

  • fromSurface: The sag-based surface you want to convert to a TrueFreeForm representation.
  • gridNx: The number of grid points in the x-direction.
  • gridNy: The number of grid points in the y-direction.

///

Parameters:

  • limitToClearAperture: If true, limit the grid sampling to the clear aperture of the original surface.

Returns:

null on success; an IMessage otherwise

Parameters:

  • int fromSurface
  • int gridNx
  • int gridNy
  • bool limitToClearAperture

Return type: IMessage

Function CanExportPointCloud

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

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

Parameters:

  • Surface: The surface you want to check for point cloud export.

Returns:

True if surface can be exported, False otherwise.

Parameters:

  • int Surface

Return type: bool

Function 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:

  • Surface: The sag-based surface you want to convert to a freeform representation.

Parameters:

  • filename: The filename for the point cloud data file.

Parameters:

  • gridNx: The number of sample points in the x-direction.
  • gridNy: The number of sample points in the y-direction.
  • includeSurfaceNormals: Whether to include surface normal information in the file.
  • format: What format to use for the file, choices are ASCII, Binary, and CompressedBinary.

Returns:

null on success; an IMessage otherwise

Parameters:

  • int Surface
  • string filename
  • int gridNx
  • int gridNy
  • bool includeSurfaceNormals
  • PointCloudFileFormat format

Return type: IMessage

Function 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:

  • Surface: Desired surface (0 to NumberOfSurfaces)

Returns:

The glass name if found, otherwise an empty string

Parameters:

  • int Surface

Return type: string

Function GetId

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

Get the unique identifier for the given surface.

Parameters:

  • surface: A surface number

Returns:

The identifier of the surface.

Parameters:

  • int surface

Return type: long

Function GetTool_TiltDecenterElements

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

Gets the settings for the Tilt/Decenter Element tool.

Return type: ILDETool_TiltDecenterElements

Function 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:

  • settings: The settings.

Returns:

Error message if any occurs.

Parameters:

Return type: IMessage

Function SetJonesMatrixData

void ZOSAPI.Editors.LDE.ILensDataEditor.SetJonesMatrixData(int surface, bool isRetarder, double delta, double angle, double transmission)

Parameters:

  • int surface
  • bool isRetarder
  • double delta
  • double angle
  • double transmission

Return type: void

Function SetMuellerMatrixData

void ZOSAPI.Editors.LDE.ILensDataEditor.SetMuellerMatrixData(int surface, bool isRetarder, double delta, double angle, double transmission, double dop)

Parameters:

  • int surface
  • bool isRetarder
  • double delta
  • double angle
  • double transmission
  • double dop

Return type: void

Connect with Ansys