How can I change Mechanical Options via script?

Landon Mitchell Kanner
Landon Mitchell Kanner Member, Employee Posts: 287
100 Comments 25 Answers 25 Likes Photogenic
✭✭✭✭

In Mechanical scripting, I would like to change the options found under Files > Options...

Tagged:

Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 287
    100 Comments 25 Answers 25 Likes Photogenic
    ✭✭✭✭

    ExtAPI.Application.ScriptByName("jscript").ExecuteCommand('WB.PreferenceMgr.Preference("PID_Accelerated_Graphics") = -1;')

    You can determine the internal name of the option (e.g. "PID_Accelerated_Graphics" in the above example) and its possible values from the dsPreferences.xml file, which can be found in the user's appdata folder, for example:
    C:\Users\userid\AppData\Roaming\Ansys\v242\en-us\dsPreferences.xml