Skip to main content

About changing Preferences setting in ZOS-API

  • Jun 29, 2021 3:01 AM UTC
  • 1 reply
  • 225 views

Michael Cheng
Zemax Staff
Forum|alt.badge.img+2

Here are some notes for references if you are trying to change the preferences settings in ZOS-API!

  1. The ZOSAPI.IZOSAPI_Connection.PreferencesFile only works in standalone mode and not in other 3 modes.

  2. When you didn't specify a PreferenceFile (or when the given path is wrong), all settings in the preferences cannot be changed by API. In other words, only in standalone mode, you can change preferences settings.

  3. The only way to read a second preferencesFile is to close the current IZOSAPI_Application, change the path, and reconstruct the IZOSAPI_Application. In other words, I cannot read a new PreferenceFile in real time when I’m opening a file via ZOS-API in the standalone application mode.

Best regards,

Michael

1 reply

Benjamin.N
Forum|alt.badge.img
  • Visible
  • Apr 29, 2026 10:04 AM UTC

Hi Michael,

do you know if anything has changed in newer releases of Zemax OpticStudio / ZOS-API?
Especially regarding modifying preferences outside standalone mode or switching preference files without reinitializing the application?