How can I change Mechanical Options via script?

Landon Mitchell Kanner
Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 327
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭

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

Tagged:

Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 327
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    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