ZOSAPI.IZOSAPI_Application Interface Reference
Last update: 17.07.2025This interface contains all information about the current ZOS-API connection, as well as methods for accessing an Optical System. This interface can only be retrieved from a connection interface - ZOSAPI.IZOSAPI_Connection for more information. More...
Public Member Functions | |
| IOpticalSystem | GetSystemAt (int pos) |
| Gets the system at the specified index. Note that. | |
| bool | CloseSystemAt (int pos, bool saveIfNeeded) |
| Closes the system at the specified index. | |
| IOpticalSystem | LoadNewSystem (String LensFile) |
| Creates a new optical system, and loads the specified lens file. | |
| IOpticalSystem | CreateNewSystem (SystemType mode) |
| Creates a new empty optical system, in the specified mode. | |
| void | UpdateFileLists () |
| Update the cached file lists. (For example, if you've saved a 'STEP' file, you'll need to call this function before trying to use that file later in your code.) | |
| string | GetDate () |
| This item extracts the current date and time, in the format selected by the user in the Zemax environment dialog box. | |
| void | CloseApplication () |
| Shut down the Optic Studio process. | |
| void | CheckForUpdates () |
| Populate the available updates status (see CheckForUpdatesStatus and CheckForUpdatesVersion). | |
| void | ClearMessageLog () |
| bool | BeginMessageLogging () |
| bool | EndMessageLogging () |
| string | RetrieveLogMessages () |
| IZOSAPI_Callback | LoadCCallback (string cLib, string callbackName, ISettingsData settings) |
| IMessage | RegisterCOperandCallback (string cLib, string callbackName, ISettingsData settings) |
| IZOSAPI_Callback | LoadNETCallback (string fromAssembly, string typeName, ISettingsData settings) |
| IMessage | RegisterNETOperandCallback (string fromAssembly, string typeName, ISettingsData settings) |
| bool | CopySettingsData (ISettingsData from, ISettingsData to) |
| ISettingsData | CreateSettings () |
| ISettingsData | CreateSettingsFromParent (IZAPI_BaseObject parent) |
| IDataDictionary | OpenDataFile (string fileName) |
| IDataDictionary | CreateDataFile (string fileName, ZemaxFileTypes type, int data1, int data2) |
| string | RunCommand (string command) |
| For internal debugging purposes only. | |
Properties | |
| LicenseStatusType | LicenseStatus [get] |
| Gets the license status. Note that this displays the license edition if successful, or an error code if unsucessful. | |
| bool | IsValidLicenseForAPI [get] |
| Gets a value indicating whether this the API is currently useable. | |
| string | InitializationErrors [get] |
| Gets the initialization errors (similar to InitializationErrorCode). | |
| string | InitializationErrorCode [get] |
| Gets the initialization error code for debug purposes. This should only have a value when using IZOSAPI_Connection.CreateNewApplication, and LicenseStatus is one of the errro values. | |
| ZOSAPI_Mode | Mode [get] |
| Gets the current connetion mode. Use this to check if Optic Studio is expecting a user operand / analysis / etc. | |
| string | SerialCode [get] |
| int | OpticStudioVersion [get] |
| int | ExpirationYear [get] |
| int | ExpirationMonth [get] |
| int | ExpirationDay [get] |
| int | NumberOfOpticalSystems [get] |
| Gets the current number of open optical systems. Note that there will always be at least one, the PrimarySystem. | |
| IOpticalSystem | PrimarySystem [get] |
| Gets the primary system. When Mode is ZOSAPI_Mode.Server, this will initially be an empty sequential system. For ZOSAPI_Mode.Plugin this will be the live optical system. For all other modes, it will be a copy of the optical system. | |
| int | NumberOfCPUs [get] |
| string | ProgramDir [get] |
| Gets the Program directory (e.g. C:\Program Files\Zemax OpticStudio). | |
| string | LensDir [get] |
| Gets the Lens directory (e.g. C:\Users\John.Doe\My Documents\Zemax\Samples). Note that this is the same as SamplesDir. | |
| string | ObjectsDir [get] |
| Gets the Objects directory (e.g. C:\Users\John.Doe\My Documents\Zemax\OBJECTS). | |
| string | GlassDir [get] |
| Gets the Glass directory (e.g. C:\Users\John.Doe\My Documents\Zemax\GLASSCAT). | |
| string | ZPLDir [get] |
| Gets the ZPL macros directory (e.g. C:\Users\John.Doe\My Documents\Zemax\MACROS). | |
| string | CoatingDir [get] |
| Gets the Coating directory (e.g. C:\Users\John.Doe\My Documents\Zemax\COATINGS). | |
| string | POPDir [get] |
| Gets the POP directory (e.g. C:\Users\John.Doe\My Documents\Zemax\BEAMFILES). | |
| string | ImagesDir [get] |
| Gets the Images directory (e.g. C:\Users\John.Doe\My Documents\Zemax\IMAFILES). | |
| string | SolidWorksFilesDir [get] |
| Gets the SolidWorks files directory (e.g. C:\Users\John.Doe\My Documents\Zemax\OBJECTS\SolidWorks Files). | |
| string | AutodeskInventorFilesDir [get] |
| Gets the Autodesk Inventor files directory (e.g. C:\Users\John.Doe\My Documents\Zemax\OBJECTS\Inventor Files). | |
| string | CreoParametricFilesDir [get] |
| Gets the Creo Parametric files directory (e.g. C:\Users\John.Doe\My Documents\Zemax\OBJECTS\Creo Parametric Files). | |
| string | MATLABFilesDir [get] |
| Gets the MATLAB directory (e.g. C:\Program Files\MATLAB). | |
| string | ScatterDir [get] |
| Gets the Scatter directory (e.g. C:\Users\John.Doe\My Documents\Zemax\ScatterData). | |
| string | UndoDir [get] |
| Gets the Undo directory (e.g. C:\Users\John.Doe\My Documents\Zemax\UNDO). | |
| string | SamplesDir [get] |
| Gets the full path for the current user's samples directory (in the My Documents\Zemax\Samples\ folder by default). | |
| string | ZemaxDataDir [get] |
| Gets the full path for the current user's Zemax directory (in the My Documents\Zemax\ folder by default). | |
| IVectorData | OperandResults [get] |
| In Operand mode, used to set the output data. | |
| double | OperandArgument1 [get] |
| Argument 1 - Hx. | |
| double | OperandArgument2 [get] |
| Argument 2 - Hy. | |
| double | OperandArgument3 [get] |
| Argument 3 - Px. | |
| double | OperandArgument4 [get] |
| Argument 4 - Py. | |
| IUserAnalysisData | UserAnalysisData [get] |
| Gets the interface used to configure a User Analysis. Note that this is only available when Mode is ZOSAPI_Mode.UserAnalysis or ZOSAPI_Mode.UserAnalysisSettings. | |
| bool | TerminateRequested [get] |
| For a user analysis or extension, gets a value indicating if the user wishes to abort the calculation. | |
| bool | ShowChangesInUI [get, set] |
| If the Mode is ZOSAPI_Mode.Plugin, gets or sets a value indicating whether or not changes to the PrimarySystem are displayed in the OpticStudio user interface. | |
| string | ProgressMessage [get, set] |
| If the Mode is ZOSAPI_Mode.Plugin, this controls the status message displayed in the OpticStudio progress dialog. | |
| double | ProgressPercent [get, set] |
| If the Mode is ZOSAPI_Mode.Plugin, this controls the progress percentage displayed in the OpticStudio progress dialog. | |
| UpdateStatus | CheckForUpdatesStatus [get] |
| Gets the check for updates status. | |
| string | CheckForUpdatesData [get] |
| Gets data about the newest available product. | |
| int | CheckForUpdatesVersion [get] |
| IPreferences | Preferences [get] |
| bool | IsLoggingMessages [get] |
| int | ZOSMajorVersion [get] |
| int | ZOSMinorVersion [get] |
| int | ZOSSPVersion [get] |
| bool | IsSubscriptionLicense [get] |
| bool | IsSTARModuleEnabled [get] |
Detailed Description
This interface contains all information about the current ZOS-API connection, as well as methods for accessing an Optical System. This interface can only be retrieved from a connection interface - ZOSAPI.IZOSAPI_Connection for more information.
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_04_pull_data_from_FFTMTF.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_07_TiltDecenterAndMFOperand.cs, CSharpStandalone_08_NSCEDetectorData.cs, CSharpStandalone_09_NSC_CAD.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_12_Seq_SystemExplorer.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_18_SetMulticonfiguration.cs, CSharpStandalone_19_Surface_Properties.cs, CSharpStandalone_20_export_CAD_File.cs, CSharpStandalone_21_White_LED_Phosphor.cs, CSharpStandalone_22_seq_spot_diagram.cs, CSharpStandalone_23_ray_fan_native_manual_comparison.cs, CSharpStandalone_24_nsc_detectors.cs, CSharpStandalone_25_source_spectrum_diffraction_grating.cs, CSharpStandalone_26_modify_opticstudio_preferences.cs, and CSharpUserOperand_16_SumAbsoluteThickness.cs.
Member Function Documentation
◆ BeginMessageLogging()
| bool ZOSAPI.IZOSAPI_Application.BeginMessageLogging | ( | ) |
◆ CheckForUpdates()
| void ZOSAPI.IZOSAPI_Application.CheckForUpdates | ( | ) |
Populate the available updates status (see CheckForUpdatesStatus and CheckForUpdatesVersion).
◆ ClearMessageLog()
| void ZOSAPI.IZOSAPI_Application.ClearMessageLog | ( | ) |
◆ CloseApplication()
| void ZOSAPI.IZOSAPI_Application.CloseApplication | ( | ) |
Shut down the Optic Studio process.
Note - this method only applies when running in standalone mode. Any attempt to call API members after this call successfully executes will fail.
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_04_pull_data_from_FFTMTF.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_07_TiltDecenterAndMFOperand.cs, CSharpStandalone_08_NSCEDetectorData.cs, CSharpStandalone_09_NSC_CAD.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_12_Seq_SystemExplorer.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_18_SetMulticonfiguration.cs, CSharpStandalone_19_Surface_Properties.cs, CSharpStandalone_20_export_CAD_File.cs, CSharpStandalone_21_White_LED_Phosphor.cs, CSharpStandalone_22_seq_spot_diagram.cs, CSharpStandalone_23_ray_fan_native_manual_comparison.cs, CSharpStandalone_24_nsc_detectors.cs, CSharpStandalone_25_source_spectrum_diffraction_grating.cs, and CSharpStandalone_26_modify_opticstudio_preferences.cs.

◆ CloseSystemAt()
| bool ZOSAPI.IZOSAPI_Application.CloseSystemAt | ( | int | pos, |
| bool | saveIfNeeded | ||
| ) |
Closes the system at the specified index.
- Parameters
-
pos The index for the desired system ( to NumberOfOpticalSystems-1).1saveIfNeeded If set to true, the system will be saved to lens file before saving; otherwise, any changes will be lost.
- Returns
- if the system was closed;trueotherwise.false
◆ CopySettingsData()
| bool ZOSAPI.IZOSAPI_Application.CopySettingsData | ( | ISettingsData | from, |
| ISettingsData | to | ||
| ) |
◆ CreateDataFile()
| IDataDictionary ZOSAPI.IZOSAPI_Application.CreateDataFile | ( | string | fileName, |
| ZemaxFileTypes | type, | ||
| int | data1, | ||
| int | data2 | ||
| ) |
◆ CreateNewSystem()
| IOpticalSystem ZOSAPI.IZOSAPI_Application.CreateNewSystem | ( | SystemType | mode | ) |
Creates a new empty optical system, in the specified mode.
Usage (see Example 06 for a full sample)
C#
C++
Matlab
Python
- Parameters
-
mode The mode, either SystemType.Sequential for a sequential system, or SystemType.NonSequential for a pure non-sequential file.
- Returns
- A new, empty IOpticalSystem.
◆ CreateSettings()
| ISettingsData ZOSAPI.IZOSAPI_Application.CreateSettings | ( | ) |
◆ CreateSettingsFromParent()
| ISettingsData ZOSAPI.IZOSAPI_Application.CreateSettingsFromParent | ( | IZAPI_BaseObject | parent | ) |

◆ EndMessageLogging()
| bool ZOSAPI.IZOSAPI_Application.EndMessageLogging | ( | ) |
◆ GetDate()
| string ZOSAPI.IZOSAPI_Application.GetDate | ( | ) |
This item extracts the current date and time, in the format selected by the user in the Zemax environment dialog box.
- Returns
- The formatted date/time
◆ GetSystemAt()
| IOpticalSystem ZOSAPI.IZOSAPI_Application.GetSystemAt | ( | int | pos | ) |
Gets the system at the specified index. Note that.
0 will always be the same as PrimarySystem.
- Parameters
-
pos The index for the desired system ( to NumberOfOpticalSystems-1).0
- Returns
◆ LoadCCallback()
| IZOSAPI_Callback ZOSAPI.IZOSAPI_Application.LoadCCallback | ( | string | cLib, |
| string | callbackName, | ||
| ISettingsData | settings | ||
| ) |
◆ LoadNETCallback()
| IZOSAPI_Callback ZOSAPI.IZOSAPI_Application.LoadNETCallback | ( | string | fromAssembly, |
| string | typeName, | ||
| ISettingsData | settings | ||
| ) |

◆ LoadNewSystem()
| IOpticalSystem ZOSAPI.IZOSAPI_Application.LoadNewSystem | ( | String | LensFile | ) |
Creates a new optical system, and loads the specified lens file.
- Parameters
-
LensFile The desired lens file (.ZMX file).
- Returns
- A new IOpticalSystem if the file was successfully loaded; otherwise, .null
◆ OpenDataFile()
| IDataDictionary ZOSAPI.IZOSAPI_Application.OpenDataFile | ( | string | fileName | ) |
◆ RegisterCOperandCallback()
| IMessage ZOSAPI.IZOSAPI_Application.RegisterCOperandCallback | ( | string | cLib, |
| string | callbackName, | ||
| ISettingsData | settings | ||
| ) |
◆ RegisterNETOperandCallback()
| IMessage ZOSAPI.IZOSAPI_Application.RegisterNETOperandCallback | ( | string | fromAssembly, |
| string | typeName, | ||
| ISettingsData | settings | ||
| ) |

◆ RetrieveLogMessages()
| string ZOSAPI.IZOSAPI_Application.RetrieveLogMessages | ( | ) |
◆ RunCommand()
| string ZOSAPI.IZOSAPI_Application.RunCommand | ( | string | command | ) |
For internal debugging purposes only.
- Parameters
-
command
- Returns

◆ UpdateFileLists()
| void ZOSAPI.IZOSAPI_Application.UpdateFileLists | ( | ) |
Update the cached file lists. (For example, if you've saved a 'STEP' file, you'll need to call this function before trying to use that file later in your code.)
Property Documentation
◆ AutodeskInventorFilesDir
|
get |
Gets the Autodesk Inventor files directory (e.g. C:\Users\John.Doe\My Documents\Zemax\OBJECTS\Inventor Files).
The full path to the Autodesk Inventor files directory.
◆ CheckForUpdatesData
|
get |
Gets data about the newest available product.
The most recent product data.
◆ CheckForUpdatesStatus
|
get |
Gets the check for updates status.
The current status. Note that you must call CheckForUpdates to ensure the results are up-to-date.
◆ CheckForUpdatesVersion
|
get |
◆ CoatingDir
|
get |
Gets the Coating directory (e.g. C:\Users\John.Doe\My Documents\Zemax\COATINGS).
The full path to the Coating directory.
◆ CreoParametricFilesDir
|
get |
Gets the Creo Parametric files directory (e.g. C:\Users\John.Doe\My Documents\Zemax\OBJECTS\Creo Parametric Files).
The full path to the Creo Parameteric files directory.
◆ ExpirationDay
|
get |
◆ ExpirationMonth
|
get |
◆ ExpirationYear
|
get |
◆ GlassDir
|
get |
Gets the Glass directory (e.g. C:\Users\John.Doe\My Documents\Zemax\GLASSCAT).
The full path to the Glass directory.
◆ ImagesDir
|
get |
Gets the Images directory (e.g. C:\Users\John.Doe\My Documents\Zemax\IMAFILES).
The full path to the Images directory.
◆ InitializationErrorCode
|
get |
Gets the initialization error code for debug purposes. This should only have a value when using IZOSAPI_Connection.CreateNewApplication, and LicenseStatus is one of the errro values.
The initialization error code.
◆ InitializationErrors
|
get |
Gets the initialization errors (similar to InitializationErrorCode).
The initialization errors.
◆ IsLoggingMessages
|
get |
◆ IsSTARModuleEnabled
|
get |
◆ IsSubscriptionLicense
|
get |
◆ IsValidLicenseForAPI
|
get |
Gets a value indicating whether this the API is currently useable.
true if this instance is valid license for API; otherwise, false.
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_04_pull_data_from_FFTMTF.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_07_TiltDecenterAndMFOperand.cs, CSharpStandalone_08_NSCEDetectorData.cs, CSharpStandalone_09_NSC_CAD.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_12_Seq_SystemExplorer.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_18_SetMulticonfiguration.cs, CSharpStandalone_19_Surface_Properties.cs, CSharpStandalone_20_export_CAD_File.cs, CSharpStandalone_21_White_LED_Phosphor.cs, CSharpStandalone_22_seq_spot_diagram.cs, CSharpStandalone_23_ray_fan_native_manual_comparison.cs, CSharpStandalone_24_nsc_detectors.cs, CSharpStandalone_25_source_spectrum_diffraction_grating.cs, CSharpStandalone_26_modify_opticstudio_preferences.cs, and CSharpUserOperand_16_SumAbsoluteThickness.cs.
◆ LensDir
|
get |
Gets the Lens directory (e.g. C:\Users\John.Doe\My Documents\Zemax\Samples). Note that this is the same as SamplesDir.
The full path to the Lens directory.
◆ LicenseStatus
|
get |
Gets the license status. Note that this displays the license edition if successful, or an error code if unsucessful.
Usage (see Example 10 for a full sample)
C#
C++
Matlab
Python
The license status.
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_04_pull_data_from_FFTMTF.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_07_TiltDecenterAndMFOperand.cs, CSharpStandalone_08_NSCEDetectorData.cs, CSharpStandalone_09_NSC_CAD.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_12_Seq_SystemExplorer.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_18_SetMulticonfiguration.cs, CSharpStandalone_19_Surface_Properties.cs, CSharpStandalone_20_export_CAD_File.cs, CSharpStandalone_21_White_LED_Phosphor.cs, CSharpStandalone_22_seq_spot_diagram.cs, CSharpStandalone_23_ray_fan_native_manual_comparison.cs, CSharpStandalone_24_nsc_detectors.cs, CSharpStandalone_25_source_spectrum_diffraction_grating.cs, CSharpStandalone_26_modify_opticstudio_preferences.cs, and CSharpUserOperand_16_SumAbsoluteThickness.cs.
◆ MATLABFilesDir
|
get |
Gets the MATLAB directory (e.g. C:\Program Files\MATLAB).
The full path to the MATLAB directory.
◆ Mode
|
get |
Gets the current connetion mode. Use this to check if Optic Studio is expecting a user operand / analysis / etc.
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_04_pull_data_from_FFTMTF.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_07_TiltDecenterAndMFOperand.cs, CSharpStandalone_08_NSCEDetectorData.cs, CSharpStandalone_09_NSC_CAD.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_12_Seq_SystemExplorer.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_18_SetMulticonfiguration.cs, CSharpStandalone_19_Surface_Properties.cs, CSharpStandalone_20_export_CAD_File.cs, CSharpStandalone_21_White_LED_Phosphor.cs, CSharpStandalone_22_seq_spot_diagram.cs, CSharpStandalone_23_ray_fan_native_manual_comparison.cs, CSharpStandalone_24_nsc_detectors.cs, CSharpStandalone_25_source_spectrum_diffraction_grating.cs, CSharpStandalone_26_modify_opticstudio_preferences.cs, and CSharpUserOperand_16_SumAbsoluteThickness.cs.
◆ NumberOfCPUs
|
get |
◆ NumberOfOpticalSystems
|
get |
Gets the current number of open optical systems. Note that there will always be at least one, the PrimarySystem.
The number of optical systems.
◆ ObjectsDir
|
get |
Gets the Objects directory (e.g. C:\Users\John.Doe\My Documents\Zemax\OBJECTS).
Usage (see Example 09 for a full sample)
C#
C++
Matlab
Python
The full path to the Objects directory.
- Examples
- CSharpStandalone_09_NSC_CAD.cs.
◆ OperandArgument1
|
get |
Argument 1 - Hx.
Usage (see Example 16 for a full sample)
C#
C++
◆ OperandArgument2
|
get |
Argument 2 - Hy.
Usage (see Example 16 for a full sample)
C#
C++
◆ OperandArgument3
|
get |
Argument 3 - Px.
◆ OperandArgument4
|
get |
Argument 4 - Py.
◆ OperandResults
|
get |
In Operand mode, used to set the output data.
Usage (see Example 16 for a full sample)
C#
C++
◆ OpticStudioVersion
|
get |
◆ POPDir
|
get |
Gets the POP directory (e.g. C:\Users\John.Doe\My Documents\Zemax\BEAMFILES).
The full path to the POP directory.
◆ Preferences
|
get |
◆ PrimarySystem
|
get |
Gets the primary system. When Mode is ZOSAPI_Mode.Server, this will initially be an empty sequential system. For ZOSAPI_Mode.Plugin this will be the live optical system. For all other modes, it will be a copy of the optical system.
The primary system.
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_04_pull_data_from_FFTMTF.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_07_TiltDecenterAndMFOperand.cs, CSharpStandalone_08_NSCEDetectorData.cs, CSharpStandalone_09_NSC_CAD.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_12_Seq_SystemExplorer.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_18_SetMulticonfiguration.cs, CSharpStandalone_19_Surface_Properties.cs, CSharpStandalone_20_export_CAD_File.cs, CSharpStandalone_21_White_LED_Phosphor.cs, CSharpStandalone_22_seq_spot_diagram.cs, CSharpStandalone_23_ray_fan_native_manual_comparison.cs, CSharpStandalone_24_nsc_detectors.cs, CSharpStandalone_25_source_spectrum_diffraction_grating.cs, CSharpStandalone_26_modify_opticstudio_preferences.cs, and CSharpUserOperand_16_SumAbsoluteThickness.cs.
◆ ProgramDir
|
get |
Gets the Program directory (e.g. C:\Program Files\Zemax OpticStudio).
The full path to the Program directory.
◆ ProgressMessage
|
getset |
If the Mode is ZOSAPI_Mode.Plugin, this controls the status message displayed in the OpticStudio progress dialog.
The progress message to display.
◆ ProgressPercent
|
getset |
If the Mode is ZOSAPI_Mode.Plugin, this controls the progress percentage displayed in the OpticStudio progress dialog.
The progress message to display (0-100).
◆ SamplesDir
|
get |
Gets the full path for the current user's samples directory (in the My Documents\Zemax\Samples\ folder by default).
Usage (see Example 14 for a full sample)
C#
C++
Matlab
Python
n The full path of the samples directory.
- Examples
- CSharpStandalone_01_new_file_and_quickfocus.cs, CSharpStandalone_02_NSC_ray_trace.cs, CSharpStandalone_03_open_file_and_optimise.cs, CSharpStandalone_04_pull_data_from_FFTMTF.cs, CSharpStandalone_05_Read_ZRD_File.cs, CSharpStandalone_06_nsc_phase.cs, CSharpStandalone_08_NSCEDetectorData.cs, CSharpStandalone_09_NSC_CAD.cs, CSharpStandalone_10_NSC_ZRD_filter_string.cs, CSharpStandalone_11_Basic_Seq.cs, CSharpStandalone_12_Seq_SystemExplorer.cs, CSharpStandalone_14_Seq_Tolerance.cs, CSharpStandalone_15_Seq_Optimization.cs, CSharpStandalone_17_NSC_BulkScatter.cs, CSharpStandalone_18_SetMulticonfiguration.cs, CSharpStandalone_19_Surface_Properties.cs, CSharpStandalone_20_export_CAD_File.cs, CSharpStandalone_21_White_LED_Phosphor.cs, CSharpStandalone_22_seq_spot_diagram.cs, CSharpStandalone_23_ray_fan_native_manual_comparison.cs, CSharpStandalone_24_nsc_detectors.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.
◆ ScatterDir
|
get |
Gets the Scatter directory (e.g. C:\Users\John.Doe\My Documents\Zemax\ScatterData).
The full path to the Scatter directory.
◆ SerialCode
|
get |
◆ ShowChangesInUI
|
getset |
If the Mode is ZOSAPI_Mode.Plugin, gets or sets a value indicating whether or not changes to the PrimarySystem are displayed in the OpticStudio user interface.
true if changes are displayed; otherwise, false.
◆ SolidWorksFilesDir
|
get |
Gets the SolidWorks files directory (e.g. C:\Users\John.Doe\My Documents\Zemax\OBJECTS\SolidWorks Files).
The full path to the SolidWorks files directory.
◆ TerminateRequested
|
get |
For a user analysis or extension, gets a value indicating if the user wishes to abort the calculation.
true if the use requsted terminations; otherwise, false.
◆ UndoDir
|
get |
Gets the Undo directory (e.g. C:\Users\John.Doe\My Documents\Zemax\UNDO).
The full path to the Undo directory.
◆ UserAnalysisData
|
get |
Gets the interface used to configure a User Analysis. Note that this is only available when Mode is ZOSAPI_Mode.UserAnalysis or ZOSAPI_Mode.UserAnalysisSettings.
The user analysis data.
◆ ZemaxDataDir
|
get |
Gets the full path for the current user's Zemax directory (in the My Documents\Zemax\ folder by default).
Usage (see Example 11 for a full sample)
C#
C++
Matlab
Python
The full path of the Zemax directory.
◆ ZOSMajorVersion
|
get |
◆ ZOSMinorVersion
|
get |
◆ ZOSSPVersion
|
get |
◆ ZPLDir
|
get |
Gets the ZPL macros directory (e.g. C:\Users\John.Doe\My Documents\Zemax\MACROS).
The full path to the ZPL directory.