    

 ## On this page

  

 

 # Example 10 - C# 

 Last update: 16.07.2025 

# <a class="anchor" id="ex10_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.Analysis.Data](namespace_z_o_s_a_p_i_1_1_analysis_1_1_data.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);

 

 // Add your custom code here...

 

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

 

 // Open File, Save to New Name

 string file = "\\\\Non-Sequential\\\\Ray Splitting\\\\Beam splitter.zos";

 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) + file, false);

 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\\\\e10\_NSC\_ray\_trace.zos");

 

 // Run an NSC Ray Trace, Save .zrd file

 [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(); // Open NSC RayTrace tool

 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); // Clear all detectors

 // Set up RayTrace tool

 NSCRayTrace.IgnoreErrors = true;

 NSCRayTrace.SaveRays = true;

 NSCRayTrace.SaveRaysFile = "e10\_API\_RayTrace.ZRD"; // Saves to same directory as lens file

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

 

 // Open Detector Viewer, view previously saved .zrd file

 [IA\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml) DetectorView = TheSystem.[Analyses](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a830cf50c046528c752605eea3cf5e899).New_DetectorViewer();

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

 DetectorView_Settings.RayDatabaseFilename = "e10\_API\_RayTrace.ZRD";

 DetectorView_Settings.ShowAs = [DetectorViewerShowAsTypes](namespace_z_o_s_a_p_i_1_1_analysis.xhtml#a7adc1716b350c3c4f7508aec5d624e88).FalseColor;

 DetectorView_Settings.Filter = "X\_HIT(2, 4)"; // Detector will only display rays which hit object 2 exactly 4 times

 

 DetectorView.[ApplyAndWaitForCompletion](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#aff285af72f196b9c4915c531ff9873a4)(); // Apply Settings to Detector Viewer

 

 // Retrieve detector data and detector information

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

 

 [Double](namespace_z_o_s_a_p_i_1_1_common.xhtml#a3f54742c5ea7ea3449f67a65dea61289ad909d38d705ce75386dd86e611a82f5b) total_hits, total_flux;

 [Boolean](namespace_z_o_s_a_p_i_1_1_common.xhtml#a3f54742c5ea7ea3449f67a65dea61289a27226c864bac7454a8504f8edb15d95b) hits_bool_return, flux_bool_return, dims_bool_return;

 UInt32 X_detectorDims, Y_detectorDims;

 hits_bool_return = TheNCE.[GetDetectorData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a89995c8b4a327b293c4205719ac91ca0)(4, -3, 0, out total_hits); // Object Number=4, Pix -3 &amp; Data=0 (total hits)

 flux_bool_return = TheNCE.[GetDetectorData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a89995c8b4a327b293c4205719ac91ca0)(4, 0, 0, out total_flux); // Object Number=4, Pix=0 &amp; Data=0 (total flux)

 dims_bool_return = TheNCE.[GetDetectorDimensions](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a1355b5a84a418f9493ee0c3303125230)(4, out X_detectorDims, out Y_detectorDims); // get number of pixels in X, Y

 Console.WriteLine("total hits = " + total_hits + "\\n" + "total flux = " + total_flux);

 

 UInt32 length = X_detectorDims * Y_detectorDims;

 [Double](namespace_z_o_s_a_p_i_1_1_common.xhtml#a3f54742c5ea7ea3449f67a65dea61289ad909d38d705ce75386dd86e611a82f5b)[] pix = new [Double](namespace_z_o_s_a_p_i_1_1_common.xhtml#a3f54742c5ea7ea3449f67a65dea61289ad909d38d705ce75386dd86e611a82f5b)[length]; // Create array to store flux data for each pixel

 [Boolean](namespace_z_o_s_a_p_i_1_1_common.xhtml#a3f54742c5ea7ea3449f67a65dea61289a27226c864bac7454a8504f8edb15d95b) pix_bool;

 // mrh: should this be 0 or 1 index, the first Pix# is 1

 for (int i = 0; i &lt; length; i++) // loop through pixels, store value in pix

 {

 pix_bool = TheNCE.[GetDetectorData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a89995c8b4a327b293c4205719ac91ca0)(4, i, 0, out pix[i]);

 }

 

 // Save Ray Path Analysis to Text File

 if (TheApplication.[LicenseStatus](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#a95179eb8038b629caa12397723aacb3a) == [ZOSAPI](namespace_z_o_s_a_p_i.xhtml).LicenseStatusType.PremiumEdition)

 {

 [IA\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml) RayPath = TheSystem.[Analyses](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a830cf50c046528c752605eea3cf5e899).New_Analysis([AnalysisIDM](namespace_z_o_s_a_p_i_1_1_analysis.xhtml#a0a5cf0f456b9510dd8070610bf696de7).PathAnalysis);

 [ZOSAPI.Analysis.RayTracing.IAS\_PathAnalysis](interface_z_o_s_a_p_i_1_1_analysis_1_1_ray_tracing_1_1_i_a_s___path_analysis.xhtml) RayPath_settings = RayPath.[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).[RayTracing](namespace_z_o_s_a_p_i_1_1_analysis_1_1_ray_tracing.xhtml).[IAS\_PathAnalysis](interface_z_o_s_a_p_i_1_1_analysis_1_1_ray_tracing_1_1_i_a_s___path_analysis.xhtml);

 RayPath_settings.RayDatabaseFile = "e10\_API\_RayTrace.ZRD";

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

 [IAR\_](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r__.xhtml) Rays = RayPath.[GetResults](interface_z_o_s_a_p_i_1_1_analysis_1_1_i_a__.xhtml#a4c6f286eaffe67e97984cf1f91cc5cef)();

 Rays.[GetTextFile](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r__.xhtml#a44406a1a4b2bd9d16129e54bb64ba1ca)(TheApplication.[SamplesDir](interface_z_o_s_a_p_i_1_1_i_z_o_s_a_p_i___application.xhtml#ae8fc2a9409927955cc362f9262b052bb) + "\\\\API\\\\CS\\\\e10\_RayPathAnalysis.txt");

 }

 else

 {

 Console.Write("\\nThe RayPathAnalysis is a premium feature only\\n\\nPress any key to continue\\n");

 Console.ReadKey();

 }

 

 // Save!

 TheSystem.[Save](interface_z_o_s_a_p_i_1_1_i_optical_system.xhtml#a8e1c511cdf7f6048f1287532edd3aadd)();

 

 Console.WriteLine("Finished! Press any key to leave...");

 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.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\_.GetTextFile](interface_z_o_s_a_p_i_1_1_analysis_1_1_data_1_1_i_a_r__.xhtml#a44406a1a4b2bd9d16129e54bb64ba1ca)

bool GetTextFile(String Filename)

This function provides similar functionality to the DDE and ZPL commands GETTEXTFILE.



[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.RayTracing.IAS\_PathAnalysis](interface_z_o_s_a_p_i_1_1_analysis_1_1_ray_tracing_1_1_i_a_s___path_analysis.xhtml)

**Definition:** IAS_PathAnalysis.cs:40



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

bool GetDetectorDimensions(int ObjectNumber, out uint Rows, out uint Cols)

Gets the dimensions of the specified detector.



[ZOSAPI.Editors.NCE.INonSeqEditor.GetDetectorData](interface_z_o_s_a_p_i_1_1_editors_1_1_n_c_e_1_1_i_non_seq_editor.xhtml#a89995c8b4a327b293c4205719ac91ca0)

bool GetDetectorData(int ObjectNumber, int pixel, int Data, out double Value)

Gets data from a NSC detector.



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

void Save()

Saves the current system.



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

**Definition:** IAS_PathAnalysis.cs:10



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

AnalysisIDM

All available analysis types. See the I_Analyses interface for more information.

**Definition:** I_Analyses.cs:15



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

DetectorViewerShowAsTypes

**Definition:** I_ShowAs.cs:34



[ZOSAPI.Common.SettingsDataType.Boolean](namespace_z_o_s_a_p_i_1_1_common.xhtml#a3f54742c5ea7ea3449f67a65dea61289a27226c864bac7454a8504f8edb15d95b)

@ Boolean



[ZOSAPI.Common.SettingsDataType.Double](namespace_z_o_s_a_p_i_1_1_common.xhtml#a3f54742c5ea7ea3449f67a65dea61289ad909d38d705ce75386dd86e611a82f5b)

@ Double



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

**Definition:** InterfacesNCE.cs:19



[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