Most of options in SOLIDWORKS are controlled via SetUserPreference SOLIDWORKS API method. There versions of methods to control text, integer, toggle, numeric properties, etc. properties.
The easies way to find the required identifier of the user preference would be using the following System Options Table or by simply recording the macro and changing the target property. The corresponding SOLIDWORKS API call will be written to the macro.
All system options can be grouped by two categories: application level and document level.
This section contains the code examples and macros for automation user preferences and application settings.