Skip to main content

ZOS-API interface 2024 R1

ZOSAPI.Editors Namespace Reference

Last update: 17.07.2025

Namespaces

namespace  LDE
 
namespace  MCE
 
namespace  MFE
 
namespace  NCE
 
namespace  TDE
 

Classes

interface  ICoatingParameter
 
interface  IEditor
 Base interface for all five editor types. All editors can be accessed via the IOpticalSystem interface. Note that this interface can be used to retrieve basic editor information only. For more detailed data, you should use one of the editor-specific interfaces: More...
 
interface  IEditorCell
 Interface used to get and set data for a specific cell in an editor. This interface can be accessed via: More...
 
interface  IEditorRow
 Base interface for all five editor row types. General row information can be accessed via the IEditor interface. Note that this interface can be used to retrieve basic editor information only. For more detailed data, you should use one of the editor-specific interfaces: More...
 
interface  ISolveAplanatic
 
interface  ISolveAutomatic
 
interface  ISolveCenterOfCurvature
 
interface  ISolveChiefRayAngle
 
interface  ISolveChiefRayHeight
 
interface  ISolveChiefRayNormal
 
interface  ISolveCocentricRadius
 
interface  ISolveCocentricSurface
 
interface  ISolveCompensator
 
interface  ISolveConfigPickup
 
interface  ISolveData
 Base interface for all solve types. This interface can be accesed via the IEditorCell interface. Note that the S properties are for convenience only and merely cast this interface to the appropriate derived interface. See the OpticStudio documentation for details on the various solve types. More...
 
interface  ISolveDuplicateSag
 
interface  ISolveEdgeThickness
 
interface  ISolveElementPower
 
interface  ISolveFieldPickup
 
interface  ISolveFixed
 
interface  ISolveFNumber
 
interface  ISolveInvertSag
 
interface  ISolveMarginalRayAngle
 
interface  ISolveMarginalRayHeight
 
interface  ISolveMarginalRayNormal
 
interface  ISolveMaterialModel
 
interface  ISolveMaterialOffset
 
interface  ISolveMaterialSubstitute
 
interface  ISolveMaximum
 
interface  ISolveNone
 This solve type is only used for cells that do not support any type of solve. For most cells, use ISolveFixed instead. More...
 
interface  ISolveObjectPickup
 
interface  ISolveOpticalPathDifference
 
interface  ISolvePickupChiefRay
 
interface  ISolvePosition
 
interface  ISolvePupilPosition
 
interface  ISolveSurfacePickup
 
interface  ISolveThermalPickup
 
interface  ISolveVariable
 
interface  ISolveZPLMacro
 

Enumerations

enum  CellDataType { Integer , Double , String }
 
enum  EditorType {
  LDE , NCE , MFE , TDE ,
  MCE
}
 
enum  ReflectTransmitCode { Success , NoReflectDataInFile , NoTransmitDataInFile }
 
enum  SampleSides { Front = 0 , Back = 1 }
 
enum  Samplings { FiveDegrees , TwoDegrees , OneDegree }
 
enum  SolveStatus {
  Success , InvalidSolveType , InvalidRow , InvalidColumn ,
  PostSurfaceStopOnly , InvalidMacro , Failed = 10000
}
 
enum  SolveType {
  None = 0 , Fixed = 1 , Variable = 2 , SurfacePickup = 3 ,
  ZPLMacro = 4 , MarginalRayAngle = 5 , MarginalRayHeight = 6 , ChiefRayAngle = 7 ,
  MarginalRayNormal = 8 , ChiefRayNormal = 9 , Aplanatic = 10 , ElementPower = 11 ,
  CocentricSurface = 12 , CocentricRadius = 13 , FNumber = 14 , ChiefRayHeight = 15 ,
  EdgeThickness = 16 , OpticalPathDifference = 17 , Position = 18 , Compensator = 19 ,
  CenterOfCurvature = 20 , PupilPosition = 21 , MaterialSubstitute = 22 , MaterialOffset = 23 ,
  MaterialModel = 24 , Automatic = 25 , Maximum = 26 , PickupChiefRay = 27 ,
  ObjectPickup = 28 , ConfigPickup = 29 , ThermalPickup = 30 , MarginPercent = 31 ,
  CA_fill = 32 , DIA_fill = 33 , ConcentricSurface = 12 , ConcentricRadius = 13 ,
  DuplicateSag = 34 , InvertSag = 35 , FieldPickup = 10000
}
 All solve types available. Note that only a portion of the types are available for any given IEditorCell. More...
 
enum  DirectionOfRayTravel { inward = 0 , outward = 1 }
 

Enumeration Type Documentation

◆ CellDataType

Enumerator
Integer 
Double 
String 

◆ DirectionOfRayTravel

Enumerator
inward 
outward 

◆ EditorType

Enumerator
LDE 

Lens Data Editor.

NCE 

Non-sequential Component Editor.

MFE 

Merit Function Editor.

TDE 

Tolerance Data Editor.

MCE 

Multiple Configuration Editor.

◆ ReflectTransmitCode

Enumerator
Success 
NoReflectDataInFile 
NoTransmitDataInFile 

◆ SampleSides

Enumerator
Front 
Back 

◆ Samplings

Enumerator
FiveDegrees 
TwoDegrees 
OneDegree 

◆ SolveStatus

Enumerator
Success 
InvalidSolveType 
InvalidRow 
InvalidColumn 
PostSurfaceStopOnly 
InvalidMacro 
Failed 

◆ SolveType

All solve types available. Note that only a portion of the types are available for any given IEditorCell.

Usage (see Example 18 for a full sample)

C#

// An exmple of manually "Make Thermal"
TheSystem.LoadFile(TheApplication.SamplesDir + "\\Sequential\\Objectives\\Doublet.zos", false);
// Add 1 configuration (totally 2)
TheMCE.AddConfiguration(false);
// Add 12 operand (totally 13)
for (int i = 0; i < 12; i++)
TheMCE.AddOperand();
// Create an operand type array and later we will input the array into MCE by a for loop
MultiConfigOperandType[] operandtype = new MultiConfigOperandType[13]{
MultiConfigOperandType.TEMP,
MultiConfigOperandType.PRES,
MultiConfigOperandType.CRVT,
MultiConfigOperandType.THIC,
MultiConfigOperandType.GLSS,
MultiConfigOperandType.SDIA,
MultiConfigOperandType.CRVT,
MultiConfigOperandType.THIC,
MultiConfigOperandType.GLSS,
MultiConfigOperandType.SDIA,
MultiConfigOperandType.CRVT,
MultiConfigOperandType.THIC,
MultiConfigOperandType.SDIA};
// Set parameter 1 for each config operand
int[] param1value = new int[11] { 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3 };
for (int i = 0; i < 11; i++)
TheMCE.GetOperandAt(i + 3).Param1 = param1value[i];
// Set type for each config operand
for (int i = 0; i < 13; i++)
TheMCE.GetOperandAt(i + 1).ChangeType(operandtype[i]);
// Set Thermal Pickup solves
ISolveData thermalpickupsolve = TheMCE.GetOperandAt(1).GetOperandCell(1).CreateSolveType(ZOSAPI.Editors.SolveType.ThermalPickup);
thermalpickupsolve._S_ThermalPickup.Configuration = 1;
int[] thermalpickup_num = new int[9] { 3, 4, 6, 7, 8, 10, 11, 12, 13 };
foreach (int i in thermalpickup_num)
TheMCE.GetOperandAt(i).GetOperandCell(2).SetSolveData(thermalpickupsolve);
// Set Pickup solve
ISolveData configpickupsolve = TheMCE.GetOperandAt(1).GetOperandCell(1).CreateSolveType(ZOSAPI.Editors.SolveType.ConfigPickup);
configpickupsolve._S_ConfigPickup.Configuration = 1;
TheMCE.GetOperandAt(5).GetOperandCell(2).SetSolveData(configpickupsolve);
TheMCE.GetOperandAt(9).GetOperandCell(2).SetSolveData(configpickupsolve);
// Set temperature of configuration 2 to 100 degrees
TheMCE.GetOperandAt(1).GetOperandCell(2).DoubleValue = 100;
ISystemData TheSystemData = TheSystem.SystemData;
TheSystemData.Environment.AdjustIndexToEnvironment = true;
// Save the system
TheSystem.SaveAs(TheApplication.SamplesDir + "\\API\\CS\\e18_Doublet_MakeTermal.zos");
Definition: InterfacesEditors.cs:12
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5

C++

// An exmple of manually "Make Thermal"
TheSystem->LoadFile(TheApplication->SamplesDir + "\\Sequential\\Objectives\\Doublet.zos", false);
// Add 1 configuration (totally 2)
TheMCE->AddConfiguration(false);
// Add 12 operand (totally 13)
for (int i = 0; i < 12; i++)
TheMCE->AddOperand();
// Create an operand type array and later we will input the array into MCE by a for loop
MultiConfigOperandType *operandtype = new MultiConfigOperandType[13]{
MultiConfigOperandType_TEMP,
MultiConfigOperandType_PRES,
MultiConfigOperandType_CRVT,
MultiConfigOperandType_THIC,
MultiConfigOperandType_GLSS,
MultiConfigOperandType_SDIA,
MultiConfigOperandType_CRVT,
MultiConfigOperandType_THIC,
MultiConfigOperandType_GLSS,
MultiConfigOperandType_SDIA,
MultiConfigOperandType_CRVT,
MultiConfigOperandType_THIC,
MultiConfigOperandType_SDIA };
// Set parameter 1 for each config operand
int *param1value = new int[11]{ 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3 };
for (int i = 0; i < 11; i++)
TheMCE->GetOperandAt(i + 3)->Param1 = param1value[i];
// Set type for each config operand
for (int i = 0; i < 13; i++)
TheMCE->GetOperandAt(i + 1)->ChangeType(operandtype[i]);
// Set Thermal Pickup solves
ISolveDataPtr thermalpickupsolve = TheMCE->GetOperandAt(1)->GetOperandCell(1)->CreateSolveType(SolveType_ThermalPickup);
thermalpickupsolve->_S_ThermalPickup->Configuration = 1;
int *thermalpickup_num = new int[9]{ 3, 4, 6, 7, 8, 10, 11, 12, 13 };
for (int i = 0; i < 9; i++)
TheMCE->GetOperandAt(thermalpickup_num[i])->GetOperandCell(2)->SetSolveData(thermalpickupsolve);
// Set Pickup solve
ISolveDataPtr configpickupsolve = TheMCE->GetOperandAt(1)->GetOperandCell(1)->CreateSolveType(SolveType_ConfigPickup);
configpickupsolve->_S_ConfigPickup->Configuration = 1;
TheMCE->GetOperandAt(5)->GetOperandCell(2)->SetSolveData(configpickupsolve);
TheMCE->GetOperandAt(9)->GetOperandCell(2)->SetSolveData(configpickupsolve);
// Set temperature of configuration 2 to 100 degrees
TheMCE->GetOperandAt(1)->GetOperandCell(2)->DoubleValue = 100;
ISystemDataPtr TheSystemData = TheSystem->SystemData;
TheSystemData->Environment->AdjustIndexToEnvironment = true;
// Save the system
TheSystem->SaveAs(TheApplication->SamplesDir + "\\API\\CPP\\e18_Doublet_MakeTermal.zos");
#if defined(_DEBUG)
// keeps console open when in debug mode
system("pause");
#endif

Matlab

% An example of manually "Make Thermal"
TheSystem.LoadFile(System.String.Concat(TheApplication.SamplesDir, '\Sequential\Objectives\Doublet.zos'), false);
% Add 1 configuration (totally 2)
TheMCE.AddConfiguration(false);
% Add 12 operands (totally 13)
for i = 0:11
TheMCE.AddOperand();
end
% Create an operand type array and later we will input the array into MCE with a for loop
operandType = NET.createArray('ZOSAPI.Editors.MCE.MultiConfigOperandType', 13);
operandType(1) = ZOSAPI.Editors.MCE.MultiConfigOperandType.TEMP;
operandType(2) = ZOSAPI.Editors.MCE.MultiConfigOperandType.PRES;
operandType(3) = ZOSAPI.Editors.MCE.MultiConfigOperandType.CRVT;
operandType(4) = ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC;
operandType(5) = ZOSAPI.Editors.MCE.MultiConfigOperandType.GLSS;
operandType(6) = ZOSAPI.Editors.MCE.MultiConfigOperandType.SDIA;
operandType(7) = ZOSAPI.Editors.MCE.MultiConfigOperandType.CRVT;
operandType(8) = ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC;
operandType(9) = ZOSAPI.Editors.MCE.MultiConfigOperandType.GLSS;
operandType(10) = ZOSAPI.Editors.MCE.MultiConfigOperandType.SDIA;
operandType(11) = ZOSAPI.Editors.MCE.MultiConfigOperandType.CRVT;
operandType(12) = ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC;
operandType(13) = ZOSAPI.Editors.MCE.MultiConfigOperandType.SDIA;
% Set parameter 1 for each config operand
param1value = [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3];
for i = 1:11
TheMCE.GetOperandAt(i + 2).Param1 = param1value(i);
end
% Set type for each config operand
for i = 1:13
TheMCE.GetOperandAt(i).ChangeType(operandType(i));
end
% Set thermal pickup solves
ThermalPickupSolve = TheMCE.GetOperandAt(1).GetOperandCell(1).CreateSolveType(ZOSAPI.Editors.SolveType.ThermalPickup);
tPickup = ThermalPickupSolve.S_ThermalPickup_;
tPickup.Configuration = 1;
ThermalPickup_num = [3, 4, 6, 7, 8, 10, 11, 12, 13];
for i = 1:numel(ThermalPickup_num)
TheMCE.GetOperandAt(ThermalPickup_num(i)).GetOperandCell(2).SetSolveData(ThermalPickupSolve);
end
% Set Pickup Solve
ConfigPickupSolve = TheMCE.GetOperandAt(1).GetOperandCell(1).CreateSolveType(ZOSAPI.Editors.SolveType.ConfigPickup);
cPickup = ConfigPickupSolve.S_ConfigPickup_;
cPickup.Configuration = 1;
GLSSops = [5, 9]; % Operands 5 and 9 are GLSS operands
for i = 1:numel(GLSSops)
ConfigPickupSolve.S_ConfigPickup_.Operand = GLSSops(i); % Set pickup solve's "operand" value to pickup from correct place
TheMCE.GetOperandAt(GLSSops(i)).GetOperandCell(2).SetSolveData(ConfigPickupSolve); % apply solve for operands 5 and 9
end
% Set temperature of configuration 2 to 100 degrees
TheMCE.GetOperandAt(1).GetOperandCell(2).DoubleValue = 100;
TheSystemData = TheSystem.SystemData;
TheSystemData.Environment.AdjustIndexToEnvironment = true;
TheSystem.SaveAs(System.String.Concat(TheApplication.SamplesDir, '\API\Matlab\e18_Doublet_MakeTermal.zos'));
Definition: InterfacesMCE.cs:11
@ MCE
Multiple Configuration Editor.

Python

# An example of manually "Make Thermal"
TheSystem.LoadFile(TheApplication.SamplesDir + "\Sequential\Objectives\Doublet.zos", False)
# Add 1 configuration (totally 2)
TheMCE.AddConfiguration(False)
# Add 12 operands (totally 13)
for i in range(0, 12):
TheMCE.AddOperand()
# Create an operand type array and later we will input the array into MCE with a for loop
operandType = [ZOSAPI.Editors.MCE.MultiConfigOperandType.TEMP, ZOSAPI.Editors.MCE.MultiConfigOperandType.PRES,
ZOSAPI.Editors.MCE.MultiConfigOperandType.CRVT, ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC,
ZOSAPI.Editors.MCE.MultiConfigOperandType.GLSS, ZOSAPI.Editors.MCE.MultiConfigOperandType.SDIA,
ZOSAPI.Editors.MCE.MultiConfigOperandType.CRVT, ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC,
ZOSAPI.Editors.MCE.MultiConfigOperandType.GLSS, ZOSAPI.Editors.MCE.MultiConfigOperandType.SDIA,
ZOSAPI.Editors.MCE.MultiConfigOperandType.CRVT, ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC,
ZOSAPI.Editors.MCE.MultiConfigOperandType.SDIA]
# Set parameter 1 for each config operand
param1value = [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3]
for i in range(0, 11):
TheMCE.GetOperandAt(i+3).Param1 = param1value[i]
# Set type for each config operand
for i in range(13):
TheMCE.GetOperandAt(i+1).ChangeType(operandType[i])
# Set thermal pickup solves
ThermalPickupSolve = TheMCE.GetOperandAt(1).GetOperandCell(1).CreateSolveType(ZOSAPI.Editors.SolveType.ThermalPickup)
ThermalPickupSolve._S_ThermalPickup.Configuration = 1
ThermalPickup_num = [3, 4, 6, 7, 8, 10, 11, 12, 13]
for i in ThermalPickup_num:
TheMCE.GetOperandAt(i).GetOperandCell(2).SetSolveData(ThermalPickupSolve)
# Set Pickup Solve
ConfigPickupSolve = TheMCE.GetOperandAt(1).GetOperandCell(1).CreateSolveType(ZOSAPI.Editors.SolveType.ConfigPickup)
ConfigPickupSolve._S_ConfigPickup.Configuration = 1
GLSSops = [5, 9] # Operands 5 and 9 are GLSS operands
for i in GLSSops:
ConfigPickupSolve._S_ConfigPickup.Operand = i # Set pickup solve's "operand" value to pickup from correct place
TheMCE.GetOperandAt(i).GetOperandCell(2).SetSolveData(ConfigPickupSolve) # apply solve for operands 5 and 9
# Set temperature of configuration 2 to 100 degrees
TheMCE.GetOperandAt(1).GetOperandCell(2).DoubleValue = 100
TheSystemData = TheSystem.SystemData
TheSystemData.Environment.AdjustIndexToEnvironment = True
TheSystem.SaveAs(TheApplication.SamplesDir + "\\API\\Python\\e18_Doublet_MakeTermal.zos")
Enumerator
None 
Fixed 
Variable 
SurfacePickup 

Lens Data Editor pickup solve.

ZPLMacro 
MarginalRayAngle 
MarginalRayHeight 
ChiefRayAngle 
MarginalRayNormal 
ChiefRayNormal 
Aplanatic 
ElementPower 
CocentricSurface 
CocentricRadius 
FNumber 
ChiefRayHeight 
EdgeThickness 
OpticalPathDifference 
Position 
Compensator 
CenterOfCurvature 
PupilPosition 
MaterialSubstitute 
MaterialOffset 
MaterialModel 
Automatic 
Maximum 
PickupChiefRay 
ObjectPickup 

Non-sequential Component Editor pickup solve.

ConfigPickup 

Multiple Configuration Editor pickup solve.

ThermalPickup 
MarginPercent 
CA_fill 
DIA_fill 
ConcentricSurface 
ConcentricRadius 
DuplicateSag 
InvertSag 
FieldPickup 

Connect with Ansys