Skip to main content

ZOS-API interface 2024 R1

ZOSAPI.SystemData.IWavelengths Interface Reference

Last update: 17.07.2025

System Explorer - Wavelengths Data. This interface can be accessed via the ISystemData interface. More...

Public Member Functions

IWavelength GetWavelength (int position)
 Gets the specified wavelength."/>.
 
IWavelength AddWavelength (double Wavelength, double Weight)
 Add a new wavelengths, after all the current wavelengths.
 
bool RemoveWavelength (int position)
 Removes the specified wavelength.
 
bool SelectWavelengthPreset (WavelengthPreset preset)
 Replaces all system wavelengths with a preset definition.
 
bool GaussianQuadrature (double minWave, double maxWave, QuadratureSteps numSteps)
 Generates a new set of system wavelengths based on a Gaussian Quadrature method.
 

Properties

int NumberOfWavelengths [get]
 Gets the number of wavelengths currently defined in the system.
 

Detailed Description

System Explorer - Wavelengths Data. This interface can be accessed via the ISystemData interface.

Examples
CSharpStandalone_12_Seq_SystemExplorer.cs.

Member Function Documentation

◆ AddWavelength()

IWavelength ZOSAPI.SystemData.IWavelengths.AddWavelength ( double  Wavelength,
double  Weight 
)

Add a new wavelengths, after all the current wavelengths.

Parameters
WavelengthThe wavelength (um).
WeightThe weight.
Returns
The new IWavelength if there were less than twelve wavelengths; otherwise,
null
.

◆ GaussianQuadrature()

bool ZOSAPI.SystemData.IWavelengths.GaussianQuadrature ( double  minWave,
double  maxWave,
QuadratureSteps  numSteps 
)

Generates a new set of system wavelengths based on a Gaussian Quadrature method.

Usage (see Example 12 for a full sample)

C#

// Select 6 wavelengths using a Gaussian Quadrature algorithm
ZOSAPI.SystemData.IWavelengths sysWave = TheSystem.SystemData.Wavelengths;
sysWave.GaussianQuadrature(0.45, 0.65, ZOSAPI.SystemData.QuadratureSteps.S6);
System Explorer - Wavelengths Data. This interface can be accessed via the ISystemData interface.
Definition: InterfacesSE.cs:649
bool GaussianQuadrature(double minWave, double maxWave, QuadratureSteps numSteps)
Generates a new set of system wavelengths based on a Gaussian Quadrature method.
Definition: InterfacesSE.cs:11
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5

C++

ZOSAPI_Interfaces::IWavelengthsPtr sysWave = TheSystem->SystemData->Wavelengths;
sysWave->GaussianQuadrature(0.45, 0.65, ZOSAPI_Interfaces::QuadratureSteps_S6);

Matlab

% Select 6 wavelengths using a Gaussian Quadrature algorithm
sysWave = TheSystem.SystemData.Wavelengths;
sysWave.GaussianQuadrature(0.45, 0.65, ZOSAPI.SystemData.QuadratureSteps.S6);

Python

# Select 6 wavelengths with Gaussian Quadrature algorithm
sysWave = TheSystem.SystemData.Wavelengths
sysWave.GaussianQuadrature(0.45, 0.65, ZOSAPI.SystemData.QuadratureSteps.S6)


Parameters
minWaveThe starting wavelength (microns).
maxWaveThe ending wavelength (microns).
numStepsThe total number of wavelengths (2-24).
Returns
Examples
CSharpStandalone_12_Seq_SystemExplorer.cs.

◆ GetWavelength()

IWavelength ZOSAPI.SystemData.IWavelengths.GetWavelength ( int  position)

Gets the specified wavelength."/>.

Usage (see Example 19 for a full sample)

C#

// ISystemData represents the System Explorer in GUI.
// We access options in System Explorer through ISystemData in ZOS-API
ISystemData TheSystemData = TheSystem.SystemData;
TheSystemData.Aperture.ApertureValue = 10;
TheSystemData.Aperture.AFocalImageSpace = true;
TheSystemData.Wavelengths.GetWavelength(1).Wavelength = 0.55;
Interfaces and methods for changing all System Explorer data. This interface can be accessed via the ...
Definition: InterfacesSE.cs:275
IWavelengths Wavelengths
Definition: InterfacesSE.cs:277
double Wavelength
Definition: InterfacesSE.cs:766
IWavelength GetWavelength(int position)
Gets the specified wavelength."/>.

C++

// ISystemData represents the System Explorer in GUI.
// We access options in System Explorer through ISystemData in ZOS-API
ISystemDataPtr TheSystemData = TheSystem->SystemData;
TheSystemData->Aperture->ApertureValue = 10;
TheSystemData->Aperture->AFocalImageSpace = true;
TheSystemData->Wavelengths->GetWavelength(1)->Wavelength = 0.55;

Matlab

% ISystemData represents the System Explorer in GUI.
% We access options in System Explorer through ISystemData in ZOS-API
TheSystemData = TheSystem.SystemData;
TheSystemData.Aperture.ApertureValue = 10;
TheSystemData.Aperture.AFocalImageSpace = true;
TheSystemData.Wavelengths.GetWavelength(1).Wavelength = 0.55;

Python

# ISystemData represents the System Explorer in GUI.
# We access options in System Explorer through ISystemData in ZOS-API
TheSystemData = TheSystem.SystemData
TheSystemData.Aperture.ApertureValue = 10
TheSystemData.Aperture.AFocalImageSpace = True
TheSystemData.Wavelengths.GetWavelength(1).Wavelength = 0.55
Parameters
positionThe wavelength * to retrieve (1-24).
Returns
The specified IWavelength, if the position is valid; otherwise, null.
Examples
CSharpStandalone_19_Surface_Properties.cs.

◆ RemoveWavelength()

bool ZOSAPI.SystemData.IWavelengths.RemoveWavelength ( int  position)

Removes the specified wavelength.

Parameters
positionThe wavelength # to remove (1-24).
Returns
true
if the position is valid and there were at least two wavelengths in the system; otherwise,
false
.

◆ SelectWavelengthPreset()

bool ZOSAPI.SystemData.IWavelengths.SelectWavelengthPreset ( WavelengthPreset  preset)

Replaces all system wavelengths with a preset definition.

Usage (see Example 15 for a full sample)

C#

//Add 3 wavelengths: F,d,C
bool slPreset = SystExplorer.Wavelengths.SelectWavelengthPreset(ZOSAPI.SystemData.WavelengthPreset.FdC_Visible);

C++

// Add 3 wavelengths: F, d, C
bool slPreset = SystExplorer->Wavelengths->SelectWavelengthPreset(WavelengthPreset::WavelengthPreset_FdC_Visible);

Matlab

%Add 3 wavelengths: F,d,C
slPreset = SystExplorer.Wavelengths.SelectWavelengthPreset(ZOSAPI.SystemData.WavelengthPreset.FdC_Visible);

Python

# Add 3 wavelengths: F,d,C
slPreset = SystExplorer.Wavelengths.SelectWavelengthPreset(ZOSAPI.SystemData.WavelengthPreset.FdC_Visible)
Parameters
presetThe new preset.
Returns
Examples
CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_11_Basic_Seq.cs, and CSharpStandalone_15_Seq_Optimization.cs.

Property Documentation

◆ NumberOfWavelengths

int ZOSAPI.SystemData.IWavelengths.NumberOfWavelengths
get

Gets the number of wavelengths currently defined in the system.

Usage (see Example 22 for a full sample)

C#

// Define batch ray trace constants
double hx = 0.0;
int max_wave = TheSystem.SystemData.Wavelengths.NumberOfWavelengths;
int num_fields = TheSystem.SystemData.Fields.NumberOfFields;
double[] hy_ary = new double[] { 0, 0.707, 1 };

C++

// Define batch ray trace constants
double hx = 0.0;
int max_wave = TheSystem->SystemData->Wavelengths->NumberOfWavelengths;
int num_fields = TheSystem->SystemData->Fields->NumberOfFields;
double hy_ary[] = { 0, 0.707, 1 };

Matlab

% define batch ray trace constants
hx = 0;
max_wave = TheSystem.SystemData.Wavelengths.NumberOfWavelengths;
hy_ary = [0, 0.707, 1];

Python

# Define batch ray trace constants
hx = 0.0
max_wave = TheSystem.SystemData.Wavelengths.NumberOfWavelengths
num_fields = TheSystem.SystemData.Fields.NumberOfFields
hy_ary = np.array([0, 0.707, 1])

The number of wavelengths.

Connect with Ansys