Macro findConfigFiles

Description
Use this macro to find your user setting configuration files.

These files:


 * system.cfg
 * user.cfg

can be renamed in order to reset FreeCAD's settings back to their original defaults. This can sometimes fix problems you are having with FreeCAD.

You should exit FreeCAD before renaming the files, and then open FreeCAD again afterwards. If renaming the files did not solve the issue you were having you can delete the new files FreeCAD created and rename the original files back to their original names in order to restore your previous settings. You can also safely delete the renamed files once you are certain you no longer need or want them, but it is recommended to rename them instead of deleting until you are certain they are no longer needed.

Note: The macro does not rename the files or make any changes to your settings. It merely finds the location of these files, copies that location to the clipboard, and (attempts to) open the folder containing these files on your computer using the default file browser.

Script
import FreeCAD import subprocess, os from PySide import QtCore,QtGui import platform __title__ = "findConfigFiles" __author__ = "TheMarkster" __url__ = "https://www.freecadweb.org/wiki/Macro_findConfigFiles" __Wiki__ = "http://www.freecadweb.org/wiki/index.php?title=Macro_findConfigFiles" __date__ = "2018.07.22" __version__ = __date__ #OS: Windows 10 """A macro to help with user configuration files --""" clipboard = QtGui.QApplication.clipboard sys = platform.system userFolder = App.getUserAppDataDir clipboard.setText(userFolder) msgBox = QtGui.QMessageBox msgBox.setWindowTitle('findConfigFiles macro') msgBox.setTextFormat(QtCore.Qt.RichText) msg = """ These files are located here on your system:  """+userFolder+"""   (Has been already copied to your clipboard.)  This macro is to aid you in renaming your user app configuration  files.  This can *sometimes* correct some issues you are having  using FreeCAD.  If it doesn't work you can always go back and  rename them back to their original names.  To reset your configuration settings, exit FreeCAD and rename these 2 files:  system.cfg  (rename to system.cfg.backup or something similar)  user.cfg    (rename to user.cfg.backup or something similar)  When you press OK we will attempt to open the folder location for you, but  you might need to open it manually if this doesn't work.  Renaming these files will reset *all* of your FreeCAD settings back to default.  (This macro does *not* make any changes to these files or to your user settings.) """ msgBox.setText(msg) msgBox.exec_ if 'Windows' in sys:     subprocess.Popen('start explorer.exe '+userFolder, shell=True) elif 'Linux' in sys:     os.system("xdg-open '%s'" % userFolder) elif 'Darwin' in sys:     subprocess.Popen(["open", userFolder]) else:     msgBox = QtGui.QMessageBox     msg = "We were unable to determine your platform, and thus cannot open your '+userFolder+' for you, but you can still do it manually.\n"     msgBox.exec_
 * 1) -*- coding: utf-8 -*-
 * 1) Word size of OS: 64-bit
 * 2) Word size of FreeCAD: 64-bit
 * 3) Version: 0.18.14061 (Git)
 * 4) Build type: Release
 * 5) Branch: master
 * 6) Hash: c4fc02cbcfff975712e977dc08f859fba71ba0ad
 * 7) Python version: 2.7.14
 * 8) Qt version: 4.8.7
 * 9) Coin version: 4.0.0a
 * 10) OCC version: 7.2.0
 * 11) Locale: English/UnitedStates (en_US)
 * 1) HTML tags are part of the source -- do not edit