    

 ## On this page

  

 

 # Example 18 - C# 

 Last update: 16.07.2025 

# <a class="anchor" id="ex18_s1"></a>C#

using System;

using [ZOSAPI](namespace_z_o_s_a_p_i.xhtml);

using [ZOSAPI.Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml);

using [ZOSAPI.Editors.MCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml);

using [ZOSAPI.Tools.General](namespace_z_o_s_a_p_i_1_1_tools_1_1_general.xhtml);

using [ZOSAPI.SystemData](namespace_z_o_s_a_p_i_1_1_system_data.xhtml);

 

namespace CSharpStandaloneApplication

{

 class Program

 {

 static void Main(string[] args)

 {

 // Find the installed version of OpticStudio

 bool isInitialized = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize();

 // Note -- uncomment the following line to use a custom initialization path

 //bool isInitialized = ZOSAPI\_NetHelper.ZOSAPI\_Initializer.Initialize(@"C:\\Program Files\\OpticStudio\\");

 if (isInitialized)

 {

 LogInfo("Found OpticStudio at: " + ZOSAPI_NetHelper.ZOSAPI_Initializer.GetZemaxDirectory());

 }

 else

 {

 HandleError("Failed to locate OpticStudio!");

 return;

 }

 

 BeginStandaloneApplication();

 }

 

 static void BeginStandaloneApplication()

 {

 // Create the initial connection class

 [ZOSAPI\_Connection](class_z_o_s_a_p_i_1_1_z_o_s_a_p_i___connection.xhtml) TheConnection = new [ZOSAPI\_Connection](class_z_o_s_a_p_i_1_1_z_o_s_a_p_i___connection.xhtml)();

 

 // Attempt to create a Standalone connection

 [IZOSAPI\_Application](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml) TheApplication = TheConnection.[CreateNewApplication](class_z_o_s_a_p_i_1_1_z_o_s_a_p_i___connection.xhtml#aadc54af7d7415a765592acf23d3a08ef)();

 if (TheApplication == null)

 {

 HandleError("An unknown connection error occurred!");

 return;

 }

 

 // Check the connection status

 if (!TheApplication.[IsValidLicenseForAPI](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a5b8d6c216c668d13d6dcb870698c247f))

 {

 HandleError("Failed to connect to OpticStudio: " + TheApplication.[LicenseStatus](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a95179eb8038b629caa12397723aacb3a));

 return;

 }

 if (TheApplication.[Mode](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a8d2a89bafe9778c14f592276e5a5eb19) != [ZOSAPI\_Mode](namespace_z_o_s_a_p_i.xhtml#a254f5f6cb4ff37c2245b456b9bb79d2a).Server)

 {

 HandleError("User plugin was started in the wrong mode: expected Server, found " + TheApplication.[Mode](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a8d2a89bafe9778c14f592276e5a5eb19).ToString());

 return;

 }

 

 [IOpticalSystem](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml) TheSystem = TheApplication.[PrimarySystem](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#aca8045fe84351622e0ee58814a2a3364);

 

 // creates new directory

 string strPath = System.IO.Path.Combine(TheApplication.[SamplesDir](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ae8fc2a9409927955cc362f9262b052bb), @"API\\CS");

 System.IO.Directory.CreateDirectory(strPath);

 

 // Add your custom code here...

 TheSystem.[LoadFile](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a6eb1455ac53555ae6f30032d85b63735)(TheApplication.[SamplesDir](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ae8fc2a9409927955cc362f9262b052bb) + "\\\\Sequential\\\\Objectives\\\\Double Gauss 28 degree field.zos", false);

 

 // Get interface of the Multi-Configuration Editor

 [IMultiConfigEditor](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml) TheMCE = TheSystem.[MCE](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#adf62f3b20bd2db8384caf4a2cece6bb4);

 // Add two configurations (totally 3)

 TheMCE.[AddConfiguration](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a8b89e3594b8c49016ffbd776d395209d)(false);

 TheMCE.[AddConfiguration](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a8b89e3594b8c49016ffbd776d395209d)(false);

 

 // Add one operand (totally 2)

 TheMCE.[AddOperand](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a7187ca845c43f0a9a7e1036584c3b9d8)();

 

 // Get interface of each operand

 [IMCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml) MCOperand1 = TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(1);

 [IMCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml) MCOperand2 = TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(2);

 // Change both operands' type to THIC

 MCOperand1.[ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a955e9f06da708ae5434062597919e4ae)([MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).THIC);

 MCOperand2.[ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a955e9f06da708ae5434062597919e4ae)([MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).THIC);

 

 // Set parameters of operands

 // If the type of operand is THIC, the first parameter here means surface number

 MCOperand1.Param1 = 0;

 MCOperand2.Param1 = 11;

 

 // Set values of opeand for each configurations

 MCOperand1.[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(1).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 10000.0;

 MCOperand1.[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(2).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 5000.0;

 MCOperand1.[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(3).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1000.0;

 

 // Refocus for each configuration

 [IQuickFocus](interface_z_o_s_a_p_i_1_1_tools_1_1_general_1_1_i_quick_focus.xhtml) quickfocus = TheSystem.[Tools](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#add3e3631eadf7955b7b341179ff1eff8).OpenQuickFocus();

 TheMCE.[SetCurrentConfiguration](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#aa10a413558c8bfca73eef5795a0549ab)(1);

 quickfocus.[RunAndWaitForCompletion](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#a26d8cae18772fd31c1d18525a3b8d9ac)();

 TheMCE.[SetCurrentConfiguration](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#aa10a413558c8bfca73eef5795a0549ab)(2);

 quickfocus.[RunAndWaitForCompletion](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#a26d8cae18772fd31c1d18525a3b8d9ac)();

 TheMCE.[SetCurrentConfiguration](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#aa10a413558c8bfca73eef5795a0549ab)(3);

 quickfocus.[RunAndWaitForCompletion](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#a26d8cae18772fd31c1d18525a3b8d9ac)();

 

 TheSystem.[SaveAs](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a32d2f472d9a6d3277f3cda76afb6d85d)(TheApplication.[SamplesDir](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ae8fc2a9409927955cc362f9262b052bb) + "\\\\API\\\\CS\\\\e18\_Double\_Gauss\_28\_degree\_field\_MultiConfig.zos");

 

 // An exmple of manually "Make Thermal"

 TheSystem.[LoadFile](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a6eb1455ac53555ae6f30032d85b63735)(TheApplication.[SamplesDir](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ae8fc2a9409927955cc362f9262b052bb) + "\\\\Sequential\\\\Objectives\\\\Doublet.zos", false);

 // Add 1 configuration (totally 2)

 TheMCE.[AddConfiguration](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a8b89e3594b8c49016ffbd776d395209d)(false);

 // Add 12 operand (totally 13)

 for (int i = 0; i &lt; 12; i++)

 TheMCE.[AddOperand](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a7187ca845c43f0a9a7e1036584c3b9d8)();

 

 // Create an operand type array and later we will input the array into MCE by a for loop

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1)[] operandtype = new [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1)[13]{

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).TEMP,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).PRES,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).CRVT,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).THIC,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).GLSS,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).SDIA,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).CRVT,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).THIC,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).GLSS,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).SDIA,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).CRVT,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).THIC,

 [MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1).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 &lt; 11; i++)

 TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(i + 3).[Param1](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a06739bcd5ba870ed22ddc70e0479a5d3) = param1value[i];

 

 // Set type for each config operand

 for (int i = 0; i &lt; 13; i++)

 TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(i + 1).[ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a955e9f06da708ae5434062597919e4ae)(operandtype[i]);

 

 // Set Thermal Pickup solves

 [ISolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_solve_data.xhtml) thermalpickupsolve = TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(1).[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(1).[CreateSolveType](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#aab9b45b0e5c224d1fb31bce66888d20d)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).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](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(i).[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(2).[SetSolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a5c0cbba814207920589ee69ffcfc0d36)(thermalpickupsolve);

 

 // Set Pickup solve

 [ISolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_solve_data.xhtml) configpickupsolve = TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(1).[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(1).[CreateSolveType](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#aab9b45b0e5c224d1fb31bce66888d20d)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).SolveType.ConfigPickup);

 configpickupsolve._S_ConfigPickup.Configuration = 1;

 TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(5).[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(2).[SetSolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a5c0cbba814207920589ee69ffcfc0d36)(configpickupsolve);

 TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(9).[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(2).[SetSolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a5c0cbba814207920589ee69ffcfc0d36)(configpickupsolve);

 

 // Set temperature of configuration 2 to 100 degrees

 TheMCE.[GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)(1).[GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)(2).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 100;

 [ISystemData](interface_z_o_s_a_p_i_1_1_system_data_1_1_i_system_data.xhtml) TheSystemData = TheSystem.[SystemData](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a4c4e9771e9ea51766885fdd6fb6627f5);

 TheSystemData.Environment.AdjustIndexToEnvironment = true;

 

 // Save the system

 TheSystem.[SaveAs](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a32d2f472d9a6d3277f3cda76afb6d85d)(TheApplication.[SamplesDir](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ae8fc2a9409927955cc362f9262b052bb) + "\\\\API\\\\CS\\\\e18\_Doublet\_MakeTermal.zos");

 

 

 // Clean up

 FinishStandaloneApplication(TheApplication);

 }

 

 static void FinishStandaloneApplication([IZOSAPI\_Application](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml) TheApplication)

 {

 // Note - TheApplication will close automatically when this application exits, so this isn't strictly necessary in most cases

 if (TheApplication != null)

 {

 TheApplication.[CloseApplication](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ab662a3cc1b97d8632a324b1137fa943b)();

 }

 }

 

 static void LogInfo(string message)

 {

 // TODO - add custom logging

 Console.WriteLine(message);

 }

 

 static void HandleError(string errorMessage)

 {

 // TODO - add custom error handling

 throw new Exception(errorMessage);

 }

 

 }

}

[ZOSAPI.ZOSAPI\_Connection](class_z_o_s_a_p_i_1_1_z_o_s_a_p_i___connection.xhtml)

**Definition:** ZemaxService.cs:198



[ZOSAPI.ZOSAPI\_Connection.CreateNewApplication](class_z_o_s_a_p_i_1_1_z_o_s_a_p_i___connection.xhtml#aadc54af7d7415a765592acf23d3a08ef)

IZOSAPI_Application CreateNewApplication()

Attempts to launch a new instance of Optic Studio in 'headless' mode. Note that although the Optic St...

**Definition:** ZemaxService.cs:864



[ZOSAPI.Editors.IEditorCell.DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed)

double DoubleValue

Gets or sets the double precision value of this cell. Note that if DataType is not CellDataType....

**Definition:** InterfacesEditors.cs:340



[ZOSAPI.Editors.IEditorCell.SetSolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a5c0cbba814207920589ee69ffcfc0d36)

SolveStatus SetSolveData(ISolveData Data)

Updates the system with the new solve type settings (see also CreateSolveType and GetSolveData).



[ZOSAPI.Editors.IEditorCell.CreateSolveType](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#aab9b45b0e5c224d1fb31bce66888d20d)

ISolveData CreateSolveType(SolveType type)

Creates the solve type settings for the specified solve type. Note that SetSolveData must be used to ...



[ZOSAPI.Editors.ISolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_solve_data.xhtml)

Base interface for all solve types. This interface can be accesed via the IEditorCell interface....

**Definition:** InterfacesEditors.cs:563



[ZOSAPI.Editors.MCE.IMCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml)

All data for a Multiple Configuration Editor operand. This interface can be accessed via the IMultiCo...

**Definition:** InterfacesMCE.cs:405



[ZOSAPI.Editors.MCE.IMCERow.Param1](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a06739bcd5ba870ed22ddc70e0479a5d3)

int Param1

**Definition:** InterfacesMCE.cs:485



[ZOSAPI.Editors.MCE.IMCERow.ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a955e9f06da708ae5434062597919e4ae)

bool ChangeType(MultiConfigOperandType type)

Changes to the specified operand type.



[ZOSAPI.Editors.MCE.IMCERow.GetOperandCell](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a9d7f949e81a0ec40d122027c67425a2a)

IEditorCell GetOperandCell(int configuration)

Gets the specified operand cell data.



[ZOSAPI.Editors.MCE.IMultiConfigEditor](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml)

This interface defines all properties and methods needed to interact with the Multiple Configuration ...

**Definition:** InterfacesMCE.cs:158



[ZOSAPI.Editors.MCE.IMultiConfigEditor.GetOperandAt](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a357707f4881c5a80b43d2a3de8645523)

IMCERow GetOperandAt(int OperandNumber)

Gets the specified operand data.



[ZOSAPI.Editors.MCE.IMultiConfigEditor.AddOperand](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a7187ca845c43f0a9a7e1036584c3b9d8)

IMCERow AddOperand()

Adds a new operand to the end of the editor.



[ZOSAPI.Editors.MCE.IMultiConfigEditor.AddConfiguration](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a8b89e3594b8c49016ffbd776d395209d)

bool AddConfiguration(bool withPickups)

Adds a new, last configuration.



[ZOSAPI.Editors.MCE.IMultiConfigEditor.SetCurrentConfiguration](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#aa10a413558c8bfca73eef5795a0549ab)

bool SetCurrentConfiguration(int ConfigurationNumber)

Sets the currently active configuration for the system (1 to NumberOfConfigurations).



[ZOSAPI.IOpticalSystem](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml)

Represent a complete optical system. A IOpticalSystem corresponds to a single .ZMX file....

**Definition:** Interfaces.cs:687



[ZOSAPI.IOpticalSystem.SaveAs](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a32d2f472d9a6d3277f3cda76afb6d85d)

void SaveAs(string fileName)

Saves the current system to the specified file. All future calls to Save will use the same file.



[ZOSAPI.IOpticalSystem.SystemData](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a4c4e9771e9ea51766885fdd6fb6627f5)

ISystemData SystemData

Data for configuring everything in the System Explorer.

**Definition:** Interfaces.cs:845



[ZOSAPI.IOpticalSystem.LoadFile](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a6eb1455ac53555ae6f30032d85b63735)

bool LoadFile(string LensFile, bool saveIfNeeded)

Replaces the current system with data from the specified file.



[ZOSAPI.IOpticalSystem.Tools](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#add3e3631eadf7955b7b341179ff1eff8)

IOpticalSystemTools Tools

Gets an interface used to run various tools on the optical system.

**Definition:** Interfaces.cs:932



[ZOSAPI.IOpticalSystem.MCE](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#adf62f3b20bd2db8384caf4a2cece6bb4)

IMultiConfigEditor MCE

Gets the multi-configuration editor.

**Definition:** Interfaces.cs:917



[ZOSAPI.IZOSAPI\_Application](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml)

This interface contains all information about the current ZOS-API connection, as well as methods for ...

**Definition:** Interfaces.cs:261



[ZOSAPI.IZOSAPI\_Application.IsValidLicenseForAPI](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a5b8d6c216c668d13d6dcb870698c247f)

bool IsValidLicenseForAPI

Gets a value indicating whether this the API is currently useable.

**Definition:** Interfaces.cs:287



[ZOSAPI.IZOSAPI\_Application.Mode](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a8d2a89bafe9778c14f592276e5a5eb19)

ZOSAPI_Mode Mode

Gets the current connetion mode. Use this to check if Optic Studio is expecting a user operand / anal...

**Definition:** Interfaces.cs:306



[ZOSAPI.IZOSAPI\_Application.LicenseStatus](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a95179eb8038b629caa12397723aacb3a)

LicenseStatusType LicenseStatus

Gets the license status. Note that this displays the license edition if successful,...

**Definition:** Interfaces.cs:280



[ZOSAPI.IZOSAPI\_Application.CloseApplication](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ab662a3cc1b97d8632a324b1137fa943b)

void CloseApplication()

Shut down the Optic Studio process.



[ZOSAPI.IZOSAPI\_Application.PrimarySystem](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#aca8045fe84351622e0ee58814a2a3364)

IOpticalSystem PrimarySystem

Gets the primary system. When Mode is ZOSAPI_Mode.Server, this will initially be an empty sequential ...

**Definition:** Interfaces.cs:328



[ZOSAPI.IZOSAPI\_Application.SamplesDir](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ae8fc2a9409927955cc362f9262b052bb)

string SamplesDir

Gets the full path for the current user's samples directory (in the My Documents\Zemax\Samples\ folde...

**Definition:** Interfaces.cs:505



[ZOSAPI.SystemData.ISystemData](interface_z_o_s_a_p_i_1_1_system_data_1_1_i_system_data.xhtml)

Interfaces and methods for changing all System Explorer data. This interface can be accessed via the ...

**Definition:** InterfacesSE.cs:275



[ZOSAPI.Tools.General.IQuickFocus](interface_z_o_s_a_p_i_1_1_tools_1_1_general_1_1_i_quick_focus.xhtml)

Interfaces and methods for running the Quick Focus tool. This interface can be accessed via the IOpti...

**Definition:** Tools.cs:800



[ZOSAPI.Tools.ISystemTool.RunAndWaitForCompletion](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#a26d8cae18772fd31c1d18525a3b8d9ac)

bool RunAndWaitForCompletion()

Sames as calling Run followed by WaitForCompletion.



[ZOSAPI.Editors.MCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml)

**Definition:** InterfacesMCE.cs:11



[ZOSAPI.Editors.MCE.MultiConfigOperandType](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml#a92bcb7af31a91fbaa508ee44e5abfdd1)

MultiConfigOperandType

All supported Multi Configuration operand types.

**Definition:** InterfacesMCE.cs:30



[ZOSAPI.Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml)

**Definition:** InterfacesEditors.cs:12



[ZOSAPI.SystemData](namespace_z_o_s_a_p_i_1_1_system_data.xhtml)

**Definition:** InterfacesSE.cs:11



[ZOSAPI.Tools.General](namespace_z_o_s_a_p_i_1_1_tools_1_1_general.xhtml)

**Definition:** Tools.cs:704



[ZOSAPI](namespace_z_o_s_a_p_i.xhtml)

The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...

**Definition:** IAS_FieldCurvatureAndDistortion.cs:5



[ZOSAPI.ZOSAPI\_Mode](namespace_z_o_s_a_p_i.xhtml#a254f5f6cb4ff37c2245b456b9bb79d2a)

ZOSAPI_Mode

**Definition:** Interfaces.cs:77