Skip to main content

ZOS-API interface 2024 R2 SP02

ZOSAPI.Preferences.IPreferencesGeneral Interface Reference

Last update: 17.07.2025

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. More...

Public Member Functions

bool GetIsGPUEnabled ()
 Check if GPU calculates are enabled.
 
bool SetIsGPUEnabled (bool isEnabled)
 Set whether or not to enable use of the GPU in calculations.
 
bool GetUseACIS ()
 
bool SetUseACIS (bool use)
 
bool GetUseParasolid ()
 
bool SetUseParasolid (bool use)
 

Properties

DateTimeType DateTimeFormat [get, set]
 
LanguageType Language [get, set]
 
EncodingType ZMXFileEncoding [get, set]
 
EncodingType TXTFileEncoding [get, set]
 
bool UseSessionFiles [get, set]
 
bool IncludeCalculatedDataInSession [get, set]
 
bool IncludeToleranceDataInSession [get, set]
 
bool UpdateMostRecentlyUsedList [get, set]
 This setting can be used to turn updating of the most recently used lens files in File > Open on or off.
 
string UserPreferences [get, set]
 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.
 

Detailed Description

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.

Examples
CSharpStandalone_26_modify_opticstudio_preferences.cs.

Member Function Documentation

◆ GetIsGPUEnabled()

bool ZOSAPI.Preferences.IPreferencesGeneral.GetIsGPUEnabled ( )

Check if GPU calculates are enabled.

Returns

◆ GetUseACIS()

bool ZOSAPI.Preferences.IPreferencesGeneral.GetUseACIS ( )

◆ GetUseParasolid()

bool ZOSAPI.Preferences.IPreferencesGeneral.GetUseParasolid ( )

◆ 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.

◆ SetUseACIS()

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

◆ SetUseParasolid()

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

Property Documentation

◆ DateTimeFormat

DateTimeType ZOSAPI.Preferences.IPreferencesGeneral.DateTimeFormat
getset

◆ IncludeCalculatedDataInSession

bool ZOSAPI.Preferences.IPreferencesGeneral.IncludeCalculatedDataInSession
getset

◆ IncludeToleranceDataInSession

bool ZOSAPI.Preferences.IPreferencesGeneral.IncludeToleranceDataInSession
getset

◆ Language

LanguageType ZOSAPI.Preferences.IPreferencesGeneral.Language
getset

◆ TXTFileEncoding

EncodingType ZOSAPI.Preferences.IPreferencesGeneral.TXTFileEncoding
getset

◆ UpdateMostRecentlyUsedList

bool ZOSAPI.Preferences.IPreferencesGeneral.UpdateMostRecentlyUsedList
getset

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

Examples
CSharpStandalone_26_modify_opticstudio_preferences.cs.

◆ UserPreferences

string ZOSAPI.Preferences.IPreferencesGeneral.UserPreferences
getset

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.

Examples
CSharpStandalone_26_modify_opticstudio_preferences.cs.

◆ UseSessionFiles

bool ZOSAPI.Preferences.IPreferencesGeneral.UseSessionFiles
getset

◆ ZMXFileEncoding

EncodingType ZOSAPI.Preferences.IPreferencesGeneral.ZMXFileEncoding
getset

Connect with Ansys