I'm trying to edit preferences with Python code. And wanted to know how to get the Preferences window, or actually any window of FreeCAD.
The Preferences window can be opened like this:
Code: Select all
Gui.runCommand('Std_DlgPreferences')
For example, store the window to a variable called "prefWindow", then by accessing the variable change tabs and modes (General, Display, Workbenches, etc.), set check boxes, fill input fields, etc.
Maybe it worths mentioning that I want to edit all preferences during FreeCAD startup, so I want to write a script that fully tune the preferences then run it during FreeCAD startup.
Code: Select all
OS: Ubuntu 22.04.1 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.31063 (Git)
Build type: Unknown
Branch: master
Hash: 7b2a6a3bf7c7cd409be25630d359a316f74fa9fd
Python 3.10.6, Qt 5.15.3, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.1
Locale: English/United States (en_US)