ZOSAPI.Editors Namespace Reference
Last update: 17.07.2025Namespaces | |
| 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 |
Enumeration Type Documentation
◆ CellDataType
◆ DirectionOfRayTravel
◆ EditorType
◆ ReflectTransmitCode
◆ SampleSides
◆ Samplings
◆ SolveStatus
◆ 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);
% 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
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")