Skip to main content

Zemax OpticStudio ZOS-API 2026 R1

Interface ZOSAPI::Preferences::IPreferencesGeneral

Last update: 13.03.2026

Definition:

Allows configuration of settings from the OpticStudio Preferences -> General tab in OpticStudio. Only a subset of preferences can be configured via the ZOS-API as most settings do not have any effect.

Note - every time a setting is changed the Preference file in use will be automatically saved, but only if a valid file name is defined for IZOSAPI_Connection.PreferencesFile prior to connecting to the ZOS-API.

Members

Properties

Property DateTimeFormat

Definition:

DateTimeType ZOSAPI.Preferences.IPreferencesGeneral.DateTimeFormat

Return type: DateTimeType

Property Language

Definition:

LanguageType ZOSAPI.Preferences.IPreferencesGeneral.Language

Return type: LanguageType

Property ZMXFileEncoding

Definition:

EncodingType ZOSAPI.Preferences.IPreferencesGeneral.ZMXFileEncoding

Return type: EncodingType

Property TXTFileEncoding

Definition:

EncodingType ZOSAPI.Preferences.IPreferencesGeneral.TXTFileEncoding

Return type: EncodingType

Property UseSessionFiles

Definition:

bool ZOSAPI.Preferences.IPreferencesGeneral.UseSessionFiles

Return type: bool

Property IncludeCalculatedDataInSession

Definition:

bool ZOSAPI.Preferences.IPreferencesGeneral.IncludeCalculatedDataInSession

Return type: bool

Property IncludeToleranceDataInSession

Definition:

bool ZOSAPI.Preferences.IPreferencesGeneral.IncludeToleranceDataInSession

Return type: bool

Property UpdateMostRecentlyUsedList

Definition:

bool ZOSAPI.Preferences.IPreferencesGeneral.UpdateMostRecentlyUsedList

This setting can be used to turn updating of the most recently used lens files in File > Open on or off.

Return type: bool

Property UserPreferences

Definition:

string ZOSAPI.Preferences.IPreferencesGeneral.UserPreferences

This is a single string in which you can store anything you want. It is saved in your Preferences configuration file together with all of the regular settings. As an example, this can be used to store a flag for you to keep track whether you have configured all of the Preferences you want or not.

Return type: string

Property UITheme

Definition:

ZemaxThemes ZOSAPI.Preferences.IPreferencesGeneral.UITheme

Return type: ZemaxThemes

Property GraphicsBackground

Definition:

BackgroundColors ZOSAPI.Preferences.IPreferencesGeneral.GraphicsBackground

Return type: BackgroundColors

Public functions

Function GetIsGPUEnabled

bool ZOSAPI.Preferences.IPreferencesGeneral.GetIsGPUEnabled()

Check if GPU calculates are enabled.

Returns:

Return type: bool

Function SetIsGPUEnabled

bool ZOSAPI.Preferences.IPreferencesGeneral.SetIsGPUEnabled(bool isEnabled)

Set whether or not to enable use of the GPU in calculations.

Parameters:

  • isEnabled:

Returns:

true if the setting was successfully updated; otherwise false.

Parameters:

  • bool isEnabled

Return type: bool

Function GetUseACIS

bool ZOSAPI.Preferences.IPreferencesGeneral.GetUseACIS()

Return type: bool

Function SetUseACIS

bool ZOSAPI.Preferences.IPreferencesGeneral.SetUseACIS(bool use)

Parameters:

  • bool use

Return type: bool

Function GetUseParasolid

bool ZOSAPI.Preferences.IPreferencesGeneral.GetUseParasolid()

Return type: bool

Function SetUseParasolid

bool ZOSAPI.Preferences.IPreferencesGeneral.SetUseParasolid(bool use)

Parameters:

  • bool use

Return type: bool

Connect with Ansys