    

 ## On this page

  

 

 # Example 25 - C# 

 Last update: 17.07.2025 

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

using System;

using [ZOSAPI](namespace_z_o_s_a_p_i.xhtml);

using [ZOSAPI.Editors.NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.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);

 

 // Set up primary optical system

 TheSystem = TheApplication.[CreateNewSystem](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a024aef7880a5ba49d60db78b9b9140b5)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).SystemType.NonSequential);

 

 // Initializes NCE and loads surfaces

 // Inserts objects

 [INonSeqEditor](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml) TheNCE = TheSystem.[NCE](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#ab3cb797b606066a251c1aecd58e73f16);

 TheNCE.[InsertNewObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a93d23b9aeba9b67ea2d4690e09c64457)(1);

 TheNCE.[InsertNewObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a93d23b9aeba9b67ea2d4690e09c64457)(1);

 TheNCE.[InsertNewObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a93d23b9aeba9b67ea2d4690e09c64457)(1);

 TheNCE.[InsertNewObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a93d23b9aeba9b67ea2d4690e09c64457)(1);

 

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) o1 = TheNCE.[GetObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a4788d547c88f21153f0d2da623c3c9ec)(1);

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) o2 = TheNCE.[GetObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a4788d547c88f21153f0d2da623c3c9ec)(2);

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) o3 = TheNCE.[GetObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a4788d547c88f21153f0d2da623c3c9ec)(3);

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) o4 = TheNCE.[GetObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a4788d547c88f21153f0d2da623c3c9ec)(4);

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) o5 = TheNCE.[GetObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a4788d547c88f21153f0d2da623c3c9ec)(5);

 

 // Changes Object Type

 o1.[ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a922f21c9a14d00066023074f68b04d12)(o1.[GetObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#adc6a589b37811074cc08bdd6c3ef2804)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectType.SourceDiode));

 o2.[ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a922f21c9a14d00066023074f68b04d12)(o2.[GetObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#adc6a589b37811074cc08bdd6c3ef2804)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectType.SourceDiode));

 o3.[ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a922f21c9a14d00066023074f68b04d12)(o3.[GetObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#adc6a589b37811074cc08bdd6c3ef2804)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectType.NullObject));

 o4.[ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a922f21c9a14d00066023074f68b04d12)(o4.[GetObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#adc6a589b37811074cc08bdd6c3ef2804)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectType.DiffractionGrating));

 o5.[ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a922f21c9a14d00066023074f68b04d12)(o5.[GetObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#adc6a589b37811074cc08bdd6c3ef2804)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectType.DetectorColor));

 

 // Sets positions &amp; materials

 o3.ZPosition = 10;

 o3.TiltAboutX = 10;

 o4.RefObject = 3;

 o4.Material = "MIRROR";

 o5.YPosition = 8.45;

 o5.TiltAboutX = 40;

 

 // Sets parameters

 o1.[GetObjectCell](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#ad712fcba162df362928283b6e00b3840)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectColumn.Par7).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 5;

 o2.[GetObjectCell](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#ad712fcba162df362928283b6e00b3840)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectColumn.Par7).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 5;

 o4.[GetObjectCell](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#ad712fcba162df362928283b6e00b3840)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectColumn.Par10).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 0.6;

 o4.[GetObjectCell](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#ad712fcba162df362928283b6e00b3840)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).ObjectColumn.Par11).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1;

 

 // Changes sourcecolor to Blackbody, sets temperature, min/ max wavelength

 o1.SourcesData.SourceColor = [ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).SourceColorMode.BlackBodySpectrum;

 o1.SourcesData.SourceColorSettings._S_BlackBodySpectrum.TemperatureK = 6000;

 o1.SourcesData.SourceColorSettings._S_BlackBodySpectrum.WavelengthFrom = 0.45;

 o1.SourcesData.SourceColorSettings._S_BlackBodySpectrum.WavelengthTo = 0.65;

 

 o2.SourcesData.SourceColor = [ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml).SourceColorMode.BlackBodySpectrum;

 o2.SourcesData.SourceColorSettings._S_BlackBodySpectrum.TemperatureK = 6000;

 o2.SourcesData.SourceColorSettings._S_BlackBodySpectrum.SpectrumCount = 100;

 o2.SourcesData.SourceColorSettings._S_BlackBodySpectrum.WavelengthFrom = 0.4;

 o2.SourcesData.SourceColorSettings._S_BlackBodySpectrum.WavelengthTo = 0.7;

 

 // Sets up the MCE, adds configuration &amp;operands

 [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) TheMCE = TheSystem.[MCE](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#adf62f3b20bd2db8384caf4a2cece6bb4);

 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.[AddOperand](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#a7187ca845c43f0a9a7e1036584c3b9d8)();

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

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

 

 // change MCE to NPAR, modifies the number of Layout Rays for a Source

 for (int a = 1; a &lt;= 4; a++)

 {

 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)(a).[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)([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml).[MCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_m_c_e.xhtml).MultiConfigOperandType.NPAR);

 }

 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).[Param2](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a6201a4be90770f3bade426fa7b2d00db) = 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)(1).[Param3](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#af6be2f4aaecb46af8f3a869c8c630044) = 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)(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).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 200;

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

 

 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).[Param2](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a6201a4be90770f3bade426fa7b2d00db) = 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)(2).[Param3](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#af6be2f4aaecb46af8f3a869c8c630044) = 2;

 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).[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) = 1000000;

 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).[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) = 0;

 

 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)(3).[Param2](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a6201a4be90770f3bade426fa7b2d00db) = 2;

 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)(3).[Param3](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#af6be2f4aaecb46af8f3a869c8c630044) = 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)(3).[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) = 0;

 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)(3).[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) = 200;

 

 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)(4).[Param2](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a6201a4be90770f3bade426fa7b2d00db) = 2;

 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)(4).[Param3](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#af6be2f4aaecb46af8f3a869c8c630044) = 2;

 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)(4).[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) = 0;

 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)(4).[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) = 1000000;

 

 // Setup detector color

 double x_width = 1.5, y_width = 1.5;

 int x_pixel = 500, y_pixel = 500;

 (o5.ObjectData as [IObjectDetectorColor](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_detector_color.xhtml)).XHalfWidth = x_width;

 (o5.ObjectData as [IObjectDetectorColor](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_detector_color.xhtml)).YHalfWidth = y_width;

 (o5.ObjectData as [IObjectDetectorColor](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_detector_color.xhtml)).NumberXPixels = x_pixel;

 (o5.ObjectData as [IObjectDetectorColor](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_detector_color.xhtml)).NumberYPixels = y_pixel;

 

 

 

 // initializes StringBuilder

 System.Text.StringBuilder sbReport = new System.Text.StringBuilder();

 string resFile;

 for (var a = 1; a &lt;= TheMCE.[NumberOfConfigurations](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#aff9ad113e8d62ec394a0601a1f5188b6); a++)

 {

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

 

 // Setup and run the ray trace

 [ZOSAPI.Tools.RayTrace.INSCRayTrace](interface_z_o_s_a_p_i_1_1_tools_1_1_ray_trace_1_1_i_n_s_c_ray_trace.xhtml) NSCRayTrace = TheSystem.[Tools](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#add3e3631eadf7955b7b341179ff1eff8).OpenNSCRayTrace();

 NSCRayTrace.[ClearDetectors](interface_z_o_s_a_p_i_1_1_tools_1_1_ray_trace_1_1_i_n_s_c_ray_trace.xhtml#a4b118fa79a1c9056ded4d08c34549914)(0);

 NSCRayTrace.SplitNSCRays = false;

 NSCRayTrace.ScatterNSCRays = false;

 NSCRayTrace.UsePolarization = false;

 NSCRayTrace.IgnoreErrors = true;

 NSCRayTrace.SaveRays = false;

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

 NSCRayTrace.[Close](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#a5bfa126385b9d0c5619b1aff9a354d31)();

 

 Console.WriteLine("Finished ray trace");

 

 // Creates a new detector viewer window, changes to true color

 [ZOSAPI.Analysis.IA\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml) det = TheSystem.[Analyses](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a830cf50c046528c752605eea3cf5e899).New_Analysis([ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Analysis](namespace_z_o_s_a_p_i_1_1_analysis.xhtml).AnalysisIDM.DetectorViewer);

 [ZOSAPI.Analysis.Settings.RayTracing.IAS\_DetectorViewer](interface_z_o_s_a_p_i_1_1_analysis_1_1_settings_1_1_ray_tracing_1_1_i_a_s___detector_viewer.xhtml) det_settings = det.[GetSettings](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#af82c93423d06452642e5cb31203cc109)() as [ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Analysis](namespace_z_o_s_a_p_i_1_1_analysis.xhtml).[Settings](namespace_z_o_s_a_p_i_1_1_analysis_1_1_settings.xhtml).[RayTracing](namespace_z_o_s_a_p_i_1_1_analysis_1_1_settings_1_1_ray_tracing.xhtml).[IAS\_DetectorViewer](interface_z_o_s_a_p_i_1_1_analysis_1_1_settings_1_1_ray_tracing_1_1_i_a_s___detector_viewer.xhtml);

 det_settings.ShowAs = [ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Analysis](namespace_z_o_s_a_p_i_1_1_analysis.xhtml).DetectorViewerShowAsTypes.TrueColor;

 det.[ApplyAndWaitForCompletion](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#aff285af72f196b9c4915c531ff9873a4)();

 

 // Creates System.Single\[\] buffers to store pixel data

 Single[] rData = new float[(int)(x_pixel * y_pixel)];

 Single[] gData = new float[(int)(x_pixel * y_pixel)];

 Single[] bData = new float[(int)(x_pixel * y_pixel)];

 

 // Loads RGB data into System.Single buffer

 [ZOSAPI.Analysis.Data.IAR\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r__.xhtml) det_results = det.[GetResults](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#a4c6f286eaffe67e97984cf1f91cc5cef)();

 [ZOSAPI.Analysis.Data.IAR\_DataGridRgb](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r___data_grid_rgb.xhtml) det_raw = det_results.[GetDataGridRgb](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r__.xhtml#a7914890beda30de981931b39c0823eb5)(0) as [ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[Analysis](namespace_z_o_s_a_p_i_1_1_analysis.xhtml).[Data](namespace_z_o_s_a_p_i_1_1_analysis_1_1_data.xhtml).[IAR\_DataGridRgb](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r___data_grid_rgb.xhtml);

 det_raw.[FillValues](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r___data_grid_rgb.xhtml#ae605e5fa29f55398f4f25dc0aadb3768)((uint)(x_pixel * y_pixel), rData, gData, bData);

 

 sbReport.Append(string.Concat("Red: ", string.Join(", ", rData), "\\nGreen: ", string.Join(", ", gData), "\\nBlue: ", string.Join(", ", bData)));

 

 resFile = TheApplication.SamplesDir + "\\\\API\\\\CS\\\\e25\_source\_spectrum\_diffraction\_grating\_" + a + ".txt";

 System.IO.File.WriteAllText(resFile, sbReport.ToString());

 sbReport.Clear();

 }

 

 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\\\\e25\_source\_spectrum\_diffraction\_grating.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.Analysis.Data.IAR\_DataGridRgb](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r___data_grid_rgb.xhtml)

**Definition:** IAR_Base.cs:286



[ZOSAPI.Analysis.Data.IAR\_DataGridRgb.FillValues](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r___data_grid_rgb.xhtml#ae605e5fa29f55398f4f25dc0aadb3768)

void FillValues(uint fullSize, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] rData, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] gData, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] bData)

Retries all RGB data at once, into the specified buffers.



[ZOSAPI.Analysis.Data.IAR\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r__.xhtml)

Properties and methods for retrieving analysis window data. This interface can be accessed via the IA...

**Definition:** IAR_Base.cs:21



[ZOSAPI.Analysis.Data.IAR\_.GetDataGridRgb](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r__.xhtml#a7914890beda30de981931b39c0823eb5)

IAR_DataGridRgb GetDataGridRgb(int index)



[ZOSAPI.Analysis.IA\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml)

Base interface for all analysis windows. This interface can be accessed via the I_Analyses interface.

**Definition:** IA_Base.cs:29



[ZOSAPI.Analysis.IA\_.GetResults](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#a4c6f286eaffe67e97984cf1f91cc5cef)

IAR_ GetResults()

Gets the result data (if available) for the current analysis.



[ZOSAPI.Analysis.IA\_.GetSettings](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#af82c93423d06452642e5cb31203cc109)

IAS_ GetSettings()

Gets the settings for the current analysis.



[ZOSAPI.Analysis.IA\_.ApplyAndWaitForCompletion](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#aff285af72f196b9c4915c531ff9873a4)

IMessage ApplyAndWaitForCompletion()

Re-runs the analysis with the current settings and waits for it to finish calculating.



[ZOSAPI.Analysis.Settings.RayTracing.IAS\_DetectorViewer](interface_z_o_s_a_p_i_1_1_analysis_1_1_settings_1_1_ray_tracing_1_1_i_a_s___detector_viewer.xhtml)

**Definition:** IAS_DetectorViewer.cs:23



[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.MCE.IMCERow.Param2](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#a6201a4be90770f3bade426fa7b2d00db)

int Param2

**Definition:** InterfacesMCE.cs:499



[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.IMCERow.Param3](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_m_c_e_row.xhtml#af6be2f4aaecb46af8f3a869c8c630044)

int Param3

**Definition:** InterfacesMCE.cs:513



[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.Editors.MCE.IMultiConfigEditor.NumberOfConfigurations](interface_z_o_s_a_p_i_1_1_editors_1_1_m_c_e_1_1_i_multi_config_editor.xhtml#aff9ad113e8d62ec394a0601a1f5188b6)

int NumberOfConfigurations

Gets the total number of configurations.

**Definition:** InterfacesMCE.cs:195



[ZOSAPI.Editors.NCE.INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml)

All data for a Non-Sequential Component Editor object. This interface can be accessed via the INonSeq...

**Definition:** InterfacesNCE.cs:1198



[ZOSAPI.Editors.NCE.INCERow.ChangeType](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a922f21c9a14d00066023074f68b04d12)

bool ChangeType(IObjectTypeSettings settings)

Changes the current object to the specified type. Use GetObjectTypeSettings to get the relevant setti...



[ZOSAPI.Editors.NCE.INCERow.GetObjectCell](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#ad712fcba162df362928283b6e00b3840)

IEditorCell GetObjectCell(ObjectColumn Col)

Gets the specified object cell data.



[ZOSAPI.Editors.NCE.INCERow.GetObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#adc6a589b37811074cc08bdd6c3ef2804)

IObjectTypeSettings GetObjectTypeSettings(ObjectType type)

Create the settings for the specified type. Use this method to specify any extra data required to cha...



[ZOSAPI.Editors.NCE.INonSeqEditor](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml)

This interface defines all properties and methods needed to interact with the Non-Sequential Componen...

**Definition:** InterfacesNCE.cs:363



[ZOSAPI.Editors.NCE.INonSeqEditor.GetObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a4788d547c88f21153f0d2da623c3c9ec)

INCERow GetObjectAt(int ObjectNumber)

Gets the object at the specified position.



[ZOSAPI.Editors.NCE.INonSeqEditor.InsertNewObjectAt](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a93d23b9aeba9b67ea2d4690e09c64457)

INCERow InsertNewObjectAt(int ObjectNumber)

Inserts a new object at the specified position.



[ZOSAPI.Editors.NCE.IObjectDetectorColor](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_detector_color.xhtml)

**Definition:** InterfacesNCE.cs:3202



[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.Analyses](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a830cf50c046528c752605eea3cf5e899)

I_Analyses Analyses

Gets the analyses for the current system.

**Definition:** Interfaces.cs:925



[ZOSAPI.IOpticalSystem.NCE](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#ab3cb797b606066a251c1aecd58e73f16)

INonSeqEditor NCE

Gets the non-sequential component editor.

**Definition:** Interfaces.cs:884



[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.CreateNewSystem](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a024aef7880a5ba49d60db78b9b9140b5)

IOpticalSystem CreateNewSystem(SystemType mode)

Creates a new empty optical system, in the specified mode.



[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.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.Tools.ISystemTool.Close](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#a5bfa126385b9d0c5619b1aff9a354d31)

bool Close()

Closes this tool and frees up and associated resources.



[ZOSAPI.Tools.RayTrace.INSCRayTrace](interface_z_o_s_a_p_i_1_1_tools_1_1_ray_trace_1_1_i_n_s_c_ray_trace.xhtml)

Interfaces and methods for running a non-sequential ray trace. This interface can be accessed via the...

**Definition:** RayTrace.cs:45



[ZOSAPI.Tools.RayTrace.INSCRayTrace.ClearDetectors](interface_z_o_s_a_p_i_1_1_tools_1_1_ray_trace_1_1_i_n_s_c_ray_trace.xhtml#a4b118fa79a1c9056ded4d08c34549914)

ErrorType ClearDetectors(int DetectorNumber)

Clears the specified detectors.



[ZOSAPI.Analysis.Data](namespace_z_o_s_a_p_i_1_1_analysis_1_1_data.xhtml)

**Definition:** IAR_Base.cs:11



[ZOSAPI.Analysis.Settings.RayTracing](namespace_z_o_s_a_p_i_1_1_analysis_1_1_settings_1_1_ray_tracing.xhtml)

**Definition:** IAS_DetectorViewer.cs:6



[ZOSAPI.Analysis.Settings](namespace_z_o_s_a_p_i_1_1_analysis_1_1_settings.xhtml)

**Definition:** IAS_FieldCurvatureAndDistortion.cs:5



[ZOSAPI.Analysis](namespace_z_o_s_a_p_i_1_1_analysis.xhtml)

**Definition:** IAS_FieldCurvatureAndDistortion.cs:5



[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.NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml)

**Definition:** InterfacesNCE.cs:19



[ZOSAPI.Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml)

**Definition:** InterfacesEditors.cs:12



[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