The FreeCAD Preference Manipulation CLI Tool will be designed to streamline the customization of FreeCAD directly from the command line interface, eliminating the need for complex graphical interfaces. It will facilitate the management of FreeCAD's preferences, enabling users to perform various tasks such as modifying existing configurations, accessing preferences stored in files, and removing unnecessary settings. Whether users are adjusting preferences for personal use or system-wide configurations, this tool will offer comprehensive control. Users will be able to swiftly create tailored preferences and make precise adjustments without the inconvenience of additional GUIs, enhancing workflow efficiency.
FreeCADCmd
or freecadcmd
commands available in the system path.pip install git+https://github.com/HarshitaSaraswat/Commandline_Preference_Management.git
If you want to activate autocomplete for the commandline tool, you can follow the below steps:
argcomplete
package is installed with it but needs to be activated with the following command:
activate-global-python-argcomplete
eval "$(register-python-argcomplete freecad-preference-manager)"
source ~/.bashrc
cd Commandline_Preference_Management
freecad-preference-manager arg1 arg2...
Use freecad-preference-manager -h
to learn about all the available options in detail.
Different combinations of options can be used to execute different commands. These combilations are listed below:
GetContent
freecad-preference-manager list parameter_group_path
ListPreferences
freecad-preference-manager list parameter_group_path -d type_of_preference
GetPreference
freecad-preference-manager read parameter_group_path:preference_name
AddPreference
freecad-preference-manager create parameter_group_path:preference_name -d type_of_preference -v value_of_preference
UpdatePreference
freecad-preference-manager update parameter_group_path:preference_name -v value_of_preference
DeletePreference
freecad-preference-manager delete parameter_group_path:preference_name
The following example gives a simple demonstration of how to change the cursor of the python console in FreeCAD.
PythonConsole
:freecad-preference-manager list BaseApp/Preferences/PythonConsole
output:
>>> [('Boolean', 'PythonWordWrap', True), ('Boolean', 'PythonBlockCursor', False), ('Boolean', 'SavePythonHistory', False)]
This command outputs the
list
oftuples
for each preference present.Tuple represents:
(datatype, property name, value)
(in that particular order)
PythonBlockCursor
:freecad-preference-manager update BaseApp/Preferences/PythonConsole:PythonBlockCursor -v true
InterpreterPath
:NOTE: creating a random preference would not have any effect in FreeCAD.
InterpreterPath
is such a preference which is used here just for giving example.freecad-preference-manager create BaseApp/Preferences/PythonConsole:InterpreterPath -d String -v path/of/python.exe
freecad-preference-manager read BaseApp/Preferences/PythonConsole:InterpreterPath
output:
>>> False
This command just returns the value or the provides preference name
Boolean
preferences in BaseApp/Preferences/PythonConsole
freecad-preference-manager list BaseApp/Preferences/PythonConsole -d Bool
output:
>>> ['PythonWordWrap', 'PythonBlockCursor', 'SavePythonHistory']
This command returns a
list
of the names of the parameters
freecad-preference-manager delete BaseApp/Preferences/PythonConsole:InterpreterPath