    

 ## On this page

  

 

 # Example 21 - C# 

 Last update: 16.07.2025 

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

using System;

using [ZOSAPI](namespace_z_o_s_a_p_i.xhtml);

using [ZOSAPI.Analysis](namespace_z_o_s_a_p_i_1_1_analysis.xhtml);

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

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

using [ZOSAPI.Editors.NCE](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml);

using [ZOSAPI.Tools.RayTrace](namespace_z_o_s_a_p_i_1_1_tools_1_1_ray_trace.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...

 

 // Create a new non-sequential file

 TheSystem.[New](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a77b5517fb230d393cf7db82d8fee8a86)(false);

 TheSystem.[MakeNonSequential](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#ad333f24403925f539e8deff2027e7269)();

 // Add new catalog MISC

 TheSystem.[SystemData](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a4c4e9771e9ea51766885fdd6fb6627f5).MaterialCatalogs.AddCatalog("MISC");

 // Set Wave #1 to 0.47 micron

 TheSystem.[SystemData](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a4c4e9771e9ea51766885fdd6fb6627f5).Wavelengths.GetWavelength(1).Wavelength = 0.47;

 // Use lumens as the source unit

 TheSystem.SystemData.Units.SourceUnits = [ZOSAPI](namespace_z_o_s_a_p_i.xhtml).[SystemData](namespace_z_o_s_a_p_i_1_1_system_data.xhtml).ZemaxSourceUnits.Lumens;

 

 // Add 4 more 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.[AddObject](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#ae030e4337118aeee430f193c5206e924)();

 TheNCE.[AddObject](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#ae030e4337118aeee430f193c5206e924)();

 TheNCE.[AddObject](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#ae030e4337118aeee430f193c5206e924)();

 TheNCE.[AddObject](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#ae030e4337118aeee430f193c5206e924)();

 

 // Set 1st object as a Source File

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) Object_1 = 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);

 [IObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_type_settings.xhtml) Typeset_SourceFile = Object_1.[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)([ObjectType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#afaeb02568d1df3bbfabfe7d8f9b59285).SourceFile);

 Typeset_SourceFile.FileName1 = "RAYFILE\_LB\_T67C\_100K\_190608\_ZEMAX.DAT";

 Object_1.[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)(Typeset_SourceFile);

 Object_1.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par1).[IntegerValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#ae449d1e2d9af965fc6cec60f2a9334ce) = 5;

 Object_1.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par2).[IntegerValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#ae449d1e2d9af965fc6cec60f2a9334ce) = 1000;

 Object_1.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par3).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 2.485572;

 Object_1.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par8).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 0.47;

 Object_1.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par9).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 0.47;

 

 // Edit source data of object 1

 // SourcesData includes all the settings in Object Properties &gt; Sources

 Object_1.SourcesData.PrePropagation = -0.2;

 Object_1.SourcesData.ArrayType = [ArrayMode](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#afdd5b3906ce1ee859f6514fc54ae44c6).Rectangular;

 Object_1.SourcesData.ArrayNumberX = 5;

 Object_1.SourcesData.ArrayNumberY = 5;

 

 // Set 2nd object as CAD Part: STEP/IGES/SAT

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) Object_2 = 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);

 [IObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_type_settings.xhtml) Typeset_CADPartSTEPIGESSAT = Object_1.[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)([ObjectType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#afaeb02568d1df3bbfabfe7d8f9b59285).CADPartSTEPIGESSAT);

 Typeset_CADPartSTEPIGESSAT.FileName1 = "LB\_T67C\_190608\_GEOMETRY.STEP";

 Object_2.[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)(Typeset_CADPartSTEPIGESSAT);

 

 // Set Rays Ignore Object = Always for object 2

 // TypeData includes all settings in Object Properties &gt; Type

 Object_2.TypeData.RaysIgnoreObject = [RaysIgnoreObjectType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8f4089440ddcd9c111f99ce345e3dfc7).Always;

 

 // Set 3rd object as Cylinder Volume

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) Object_3 = 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);

 [IObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_type_settings.xhtml) Typeset_CylinderVolume = Object_3.[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)([ObjectType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#afaeb02568d1df3bbfabfe7d8f9b59285).CylinderVolume);

 Object_3.[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)(Typeset_CylinderVolume);

 // Set positions, material and parameters

 Object_3.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).ZPosition).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 0.8;

 Object_3.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Material).[Value](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a5332feff66987beb351ea0117b4c1b89) = "PMMA";

 Object_3.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par1).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1.2;

 Object_3.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par2).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 0.1;

 Object_3.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par3).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1.2;

 

 // Make Face 1 of object 3 has Lambertian scattering properties

 // To set scatter properties, you need to first create "ScatteringSettings" by "CreateScatterModelSettings()" method.

 // And then assign is to object 3 by ChangeScatterModelSettings().

 [IObjectScatteringSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_scattering_settings.xhtml) ScatType_Lam = Object_3.[CoatScatterData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a6dd470918d3d56195aecf4994eef560c).[GetFaceData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_data.xhtml#a784337a7b51eb6c4b283972986aa8039)(1).[CreateScatterModelSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_face_data.xhtml#aab27c8591e3674cede79490a9561efee)([ObjectScatteringTypes](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#aa304775d54d1966c4f42071aa30d0010).Lambertian);

 ScatType_Lam._S_Lambertian.ScatterFraction = 1;

 Object_3.[CoatScatterData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a6dd470918d3d56195aecf4994eef560c).[GetFaceData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_data.xhtml#a784337a7b51eb6c4b283972986aa8039)(1).[ChangeScatterModelSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_face_data.xhtml#aa11035827e3fe36d04a7da7c142dc6a7)(ScatType_Lam);

 Object_3.[CoatScatterData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a6dd470918d3d56195aecf4994eef560c).[GetFaceData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_data.xhtml#a784337a7b51eb6c4b283972986aa8039)(1).[NumberOfRays](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_face_data.xhtml#a6dbb88bb5802a119a890aaa4e6f9572a) = 1;

 

 // Make object 3 a volume scattering material

 // VolumePhysicsData includes all settings in Object Properties &gt; VolumePhysics.

 // Use Photoluminescence model

 Object_3.VolumePhysicsData.Model = [VolumePhysicsModelType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a53a7179cd83319c494f80d9972e2e30e).PhotoluminescenceModel;

 [IVMPS\_PhotoluminscenceModel](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_v_m_p_s___photoluminscence_model.xhtml) Photo_setting = Object_3.[VolumePhysicsData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a37ab9bc8a1099589978c636a800dd96f).[ModelSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_volume_physics_data.xhtml#ab88387c98188498097b0cebd62072cc1).[\_S\_PhotoluminescenceModel](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_volume_physics_model_settings.xhtml#a1abfcd38f597d1840ad99c41824bbab0);

 // Use Standard Model

 Photo_setting.BasicAlgorithm = false;

 // Set absorb, emission and quantum yield spectrum files

 Photo_setting.AbsorptionFile = "\_sample\_3.ZAS";

 Photo_setting.EmissionFile = "\_sample\_3.ZES";

 Photo_setting.QuantumYield = "\_sample\_3.ZQE";

 // Set efficiency spectrum to quantum yield

 Photo_setting.EfficiencySpectrum = [EfficiencySpectrumType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a9ba5d28c37279724bc7bb5a569291006).[QuantumYield](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_v_m_p_s___photoluminscence_model.xhtml#a491b030a33c41aa29d23ba7c668d24f4);

 // Set photoluminescence parameters

 Photo_setting.ExtinctionCoefficient = 1E+05;

 Photo_setting.ExtinctionWavelength = 0.47;

 Photo_setting.PLDensity = 3.1E+017;

 // Set model to ignore mie scattering

 Photo_setting.ConsiderMieScattering = false;

 

 // Set 4th object as Standard Lens

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) Object_4 = 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);

 [IObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_type_settings.xhtml) Typeset_StandardLens = Object_4.[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)([ObjectType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#afaeb02568d1df3bbfabfe7d8f9b59285).StandardLens);

 Object_4.[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)(Typeset_StandardLens);

 // Set positions

 Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).ZPosition).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 0.9;

 // To set solve for any cell, you need to first create a "ISolveData" by "CreateSolveType()" method.

 // And then assign it to the cell.

 [ISolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_solve_data.xhtml) Solve_ObjPick = Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Material).[CreateSolveType](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#aab9b45b0e5c224d1fb31bce66888d20d)([SolveType](namespace_z_o_s_a_p_i_1_1_editors.xhtml#a0e4579c2bd01e606f5ba9e7f7ad1b0ec).ObjectPickup);

 Solve_ObjPick._S_ObjectPickup.Object = 3;

 // Set parameters

 Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Material).[SetSolveData](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a5c0cbba814207920589ee69ffcfc0d36)(Solve_ObjPick);

 Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par3).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1.2;

 Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par4).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1.2;

 Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par5).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1.2;

 Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par6).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = -1.2;

 Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par8).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1.2;

 Object_4.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par9).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 1.2;

 

 // Set 5th object as Detector Color

 [INCERow](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml) Object_5 = 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);

 [IObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_type_settings.xhtml) Typeset_DetectorColor = Object_5.[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)([ObjectType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#afaeb02568d1df3bbfabfe7d8f9b59285).DetectorColor);

 Object_5.[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)(Typeset_DetectorColor);

 // Set positions, material and parameters

 Object_5.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).ZPosition).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 7;

 Object_5.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Material).[Value](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a5332feff66987beb351ea0117b4c1b89) = "ABSORB";

 Object_5.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par1).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 5;

 Object_5.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par2).[DoubleValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a448d127a24d2dee490864d76b84f94ed) = 5;

 Object_5.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par3).[IntegerValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#ae449d1e2d9af965fc6cec60f2a9334ce) = 150;

 Object_5.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par4).[IntegerValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#ae449d1e2d9af965fc6cec60f2a9334ce) = 150;

 Object_5.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par6).[IntegerValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#ae449d1e2d9af965fc6cec60f2a9334ce) = 4;

 Object_5.[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)([ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179).Par7).[IntegerValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#ae449d1e2d9af965fc6cec60f2a9334ce) = 3;

 

 // Open NSC Ray Trace tool and turn on Scatter NSC Rays and Ignore Errors

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

 RayTraceControl.SplitNSCRays = false;

 RayTraceControl.ScatterNSCRays = true;

 RayTraceControl.UsePolarization = false;

 RayTraceControl.IgnoreErrors = true;

 RayTraceControl.SaveRays = false;

 

 // Trace rays and report the progress when it's running.

 // Note that, instead an RunAndWaitCompletion(), Run() is used so that

 // the code will just go on without waiting the tracing finishs.

 // We will check the progress of tracing by a while loop.

 // You can check the properties "Progress", which is percentage integer data (1-100)

 Console.Write("Starting Tracing... ");

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

 RayTraceControl.[Run](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#a4cf991fab30856f8aeb987f4ad19582b)();

 while (RayTraceControl.[Progress](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#af8f3521e7190d895d9774c38ca51276b) != 100)

 {

 System.Threading.Thread.Sleep(1000);

 Console.Write("\\b\\b\\b\\b" + RayTraceControl.[Progress](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#af8f3521e7190d895d9774c38ca51276b).ToString("000") + "%");

 }

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

 Console.WriteLine("\\nFinished!");

 

 // Open two detector viewers for showing results in angle space and position space

 // Detector Viewer has its own settings interface: IAS\_DetectorViewer.

 // Note that not all analyses have a specific settings interface.

 [I\_Analyses](interface_z_o_s_a_p_i_1_1_analysis_1_1_i___analyses.xhtml) TheAnalysis = TheSystem.[Analyses](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a830cf50c046528c752605eea3cf5e899);

 [IA\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml) Det1 = TheAnalysis.[New\_DetectorViewer](interface_z_o_s_a_p_i_1_1_analysis_1_1_i___analyses.xhtml#a33d79db26b92873ab0850900b02ca1c2)();

 [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_Set1 = Det1.[GetSettings](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#af82c93423d06452642e5cb31203cc109)() as [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_Set1.ShowAs = [DetectorViewerShowAsTypes](namespace_z_o_s_a_p_i_1_1_analysis.xhtml#a7adc1716b350c3c4f7508aec5d624e88).TrueColor;

 Det_Set1.Smoothing = 3;

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

 

 [IA\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml) Det2 = TheAnalysis.[New\_DetectorViewer](interface_z_o_s_a_p_i_1_1_analysis_1_1_i___analyses.xhtml#a33d79db26b92873ab0850900b02ca1c2)();

 [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_Set2 = Det2.[GetSettings](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#af82c93423d06452642e5cb31203cc109)() as [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_Set2.ShowAs = [DetectorViewerShowAsTypes](namespace_z_o_s_a_p_i_1_1_analysis.xhtml#a7adc1716b350c3c4f7508aec5d624e88).TrueColor;

 Det_Set2.Smoothing = 3;

 Det_Set2.DataType = [DetectorViewerShowDataTypes](namespace_z_o_s_a_p_i_1_1_analysis.xhtml#afe0671bed30b0a4f68c0f5a44e4a6966).AngleSpace;

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

 

 

 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\\\\e21\_White\_LED\_Phosphor.zos");

 

 Console.Write("Press any key to continue...");

 Console.ReadKey();

 

 // 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.I\_Analyses](interface_z_o_s_a_p_i_1_1_analysis_1_1_i___analyses.xhtml)

Methods and interfaces for opening, closing, and retrieving analyses. This interface can be accessed ...

**Definition:** I_Analyses.cs:816



[ZOSAPI.Analysis.I\_Analyses.New\_DetectorViewer](interface_z_o_s_a_p_i_1_1_analysis_1_1_i___analyses.xhtml#a33d79db26b92873ab0850900b02ca1c2)

IA_ New_DetectorViewer()

Open a new Detector Viewer window.



[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\_.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.IEditorCell.Value](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#a5332feff66987beb351ea0117b4c1b89)

string Value

Gets or sets the value of this cell. Note that this method can be used regardless of the DataType.

**Definition:** InterfacesEditors.cs:359



[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.IEditorCell.IntegerValue](interface_z_o_s_a_p_i_1_1_editors_1_1_i_editor_cell.xhtml#ae449d1e2d9af965fc6cec60f2a9334ce)

int IntegerValue

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

**Definition:** InterfacesEditors.cs:319



[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.NCE.INCECoatScatterData.GetFaceData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_data.xhtml#a784337a7b51eb6c4b283972986aa8039)

INCECoatScatterFaceData GetFaceData(int faceNumber)

Gets coat/scatter data for the specified face (0 to NumberOfFaces-1).



[ZOSAPI.Editors.NCE.INCECoatScatterFaceData.NumberOfRays](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_face_data.xhtml#a6dbb88bb5802a119a890aaa4e6f9572a)

int NumberOfRays

**Definition:** InterfacesNCE.cs:6306



[ZOSAPI.Editors.NCE.INCECoatScatterFaceData.ChangeScatterModelSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_face_data.xhtml#aa11035827e3fe36d04a7da7c142dc6a7)

bool ChangeScatterModelSettings(IObjectScatteringSettings newSettings)



[ZOSAPI.Editors.NCE.INCECoatScatterFaceData.CreateScatterModelSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_coat_scatter_face_data.xhtml#aab27c8591e3674cede79490a9561efee)

IObjectScatteringSettings CreateScatterModelSettings(ObjectScatteringTypes type)



[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.VolumePhysicsData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a37ab9bc8a1099589978c636a800dd96f)

INCEVolumePhysicsData VolumePhysicsData

Gets the object Volume Physics data.

**Definition:** InterfacesNCE.cs:1383



[ZOSAPI.Editors.NCE.INCERow.CoatScatterData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_row.xhtml#a6dd470918d3d56195aecf4994eef560c)

INCECoatScatterData CoatScatterData

Gets the object Coat/Scatter data.

**Definition:** InterfacesNCE.cs:1355



[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.INCEVolumePhysicsData.ModelSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_n_c_e_volume_physics_data.xhtml#ab88387c98188498097b0cebd62072cc1)

IVolumePhysicsModelSettings ModelSettings

Gets the model settings for the current model type.

**Definition:** InterfacesNCE.cs:6573



[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.AddObject](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#ae030e4337118aeee430f193c5206e924)

INCERow AddObject()

Adds a new object as the last object in the system.



[ZOSAPI.Editors.NCE.IObjectScatteringSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_scattering_settings.xhtml)

Scatter model settings for a specific face. This interface can be accessed via the INCECoatScatterFac...

**Definition:** InterfacesNCE.cs:6323



[ZOSAPI.Editors.NCE.IObjectTypeSettings](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_object_type_settings.xhtml)

This interface is used for selecting any files required by a object, and for changing object types....

**Definition:** InterfacesNCE.cs:1110



[ZOSAPI.Editors.NCE.IVMPS\_PhotoluminscenceModel](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_v_m_p_s___photoluminscence_model.xhtml)

Volume Physics Model - Phosphors and Fluorescence. This interface can be accessed via the INCEVolumeP...

**Definition:** InterfacesNCE.cs:6699



[ZOSAPI.Editors.NCE.IVMPS\_PhotoluminscenceModel.QuantumYield](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_v_m_p_s___photoluminscence_model.xhtml#a491b030a33c41aa29d23ba7c668d24f4)

string QuantumYield

**Definition:** InterfacesNCE.cs:6717



[ZOSAPI.Editors.NCE.IVolumePhysicsModelSettings.\_S\_PhotoluminescenceModel](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_volume_physics_model_settings.xhtml#a1abfcd38f597d1840ad99c41824bbab0)

IVMPS_PhotoluminscenceModel _S_PhotoluminescenceModel

**Definition:** InterfacesNCE.cs:6593



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

void New(bool saveIfNeeded)

Clears all data in the current system and resets it to a default state.



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

bool MakeNonSequential()

Makes the system non-sequential if it is not already. Note that any sequential data will be lost.



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

bool Run()

Start the tool. Note that for synchronous tools (see IsAsynchronous), this call will block until comp...



[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.ISystemTool.Progress](interface_z_o_s_a_p_i_1_1_tools_1_1_i_system_tool.xhtml#af8f3521e7190d895d9774c38ca51276b)

int Progress

Gets the progress of the current tool, if supported.

**Definition:** Tools.cs:549



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

**Definition:** IAS_FieldCurvatureAndDistortion.cs:5



[ZOSAPI.Analysis.DetectorViewerShowAsTypes](namespace_z_o_s_a_p_i_1_1_analysis.xhtml#a7adc1716b350c3c4f7508aec5d624e88)

DetectorViewerShowAsTypes

**Definition:** I_ShowAs.cs:34



[ZOSAPI.Analysis.DetectorViewerShowDataTypes](namespace_z_o_s_a_p_i_1_1_analysis.xhtml#afe0671bed30b0a4f68c0f5a44e4a6966)

DetectorViewerShowDataTypes

**Definition:** I_ShowAs.cs:56



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

VolumePhysicsModelType

**Definition:** InterfacesNCE.cs:6537



[ZOSAPI.Editors.NCE.ObjectColumn](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8a580fb0503229c319af356d568e9179)

ObjectColumn

**Definition:** InterfacesNCE.cs:199



[ZOSAPI.Editors.NCE.RaysIgnoreObjectType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a8f4089440ddcd9c111f99ce345e3dfc7)

RaysIgnoreObjectType

**Definition:** InterfacesNCE.cs:5689



[ZOSAPI.Editors.NCE.EfficiencySpectrumType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#a9ba5d28c37279724bc7bb5a569291006)

EfficiencySpectrumType

**Definition:** InterfacesNCE.cs:6673



[ZOSAPI.Editors.NCE.ObjectScatteringTypes](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#aa304775d54d1966c4f42071aa30d0010)

ObjectScatteringTypes

**Definition:** InterfacesNCE.cs:6200



[ZOSAPI.Editors.NCE.ObjectType](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#afaeb02568d1df3bbfabfe7d8f9b59285)

ObjectType

All supported non-sequential object types.

**Definition:** InterfacesNCE.cs:38



[ZOSAPI.Editors.NCE.ArrayMode](namespace_z_o_s_a_p_i_1_1_editors_1_1_n_c_e.xhtml#afdd5b3906ce1ee859f6514fc54ae44c6)

ArrayMode

**Definition:** InterfacesNCE.cs:5827



[ZOSAPI.Editors](namespace_z_o_s_a_p_i_1_1_editors.xhtml)

**Definition:** InterfacesEditors.cs:12



[ZOSAPI.Editors.SolveType](namespace_z_o_s_a_p_i_1_1_editors.xhtml#a0e4579c2bd01e606f5ba9e7f7ad1b0ec)

SolveType

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

**Definition:** InterfacesEditors.cs:483



[ZOSAPI.SystemData](namespace_z_o_s_a_p_i_1_1_system_data.xhtml)

**Definition:** InterfacesSE.cs:11



[ZOSAPI.Tools.RayTrace](namespace_z_o_s_a_p_i_1_1_tools_1_1_ray_trace.xhtml)

**Definition:** RayTrace.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