From 3cf036de4cb9615f4443a7708bf7332f72daa94a Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Wed, 5 Oct 2016 13:08:10 +0200 Subject: [PATCH] FEM: pref, if ccx standard path and ccx path are not set, set ccx standard to true --- src/Mod/Fem/FemToolsCcx.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mod/Fem/FemToolsCcx.py b/src/Mod/Fem/FemToolsCcx.py index be319edce51f..fd03edf1738a 100644 --- a/src/Mod/Fem/FemToolsCcx.py +++ b/src/Mod/Fem/FemToolsCcx.py @@ -121,7 +121,7 @@ def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"): if p1.wait() == 0: ccx_path = p1.stdout.read().split('\n')[0] elif p1.wait() == 1: - error_message = "FEM: CalculiX binary ccx not found in standard system binary path. Please install ccx or set path to binary in FEM preferences.\n" + error_message = "FEM: CalculiX binary ccx not found in standard system binary path. Please install ccx or set path to binary in FEM preferences tab CalculiX.\n" if FreeCAD.GuiUp: QtGui.QMessageBox.critical(None, error_title, error_message) raise Exception(error_message) @@ -130,6 +130,12 @@ def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"): if not ccx_binary: self.ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx") ccx_binary = self.ccx_prefs.GetString("ccxBinaryPath", "") + if not ccx_binary: + FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").SetBool("UseStandardCcxLocation", True) + error_message = "FEM: CalculiX binary ccx path not set at all. The use of standard path was activated in FEM preferences tab CalculiX. Please try again!\n" + if FreeCAD.GuiUp: + QtGui.QMessageBox.critical(None, error_title, error_message) + raise Exception(error_message) self.ccx_binary = ccx_binary import subprocess @@ -153,7 +159,7 @@ def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"): except OSError as e: FreeCAD.Console.PrintError(e.message) if e.errno == 2: - error_message = "FEM: CalculiX binary ccx \'{}\' not found. Please set the CalculiX binary ccx path in FEM preferences.\n".format(ccx_binary) + error_message = "FEM: CalculiX binary ccx \'{}\' not found. Please set the CalculiX binary ccx path in FEM preferences tab CalculiX.\n".format(ccx_binary) if FreeCAD.GuiUp: QtGui.QMessageBox.critical(None, error_title, error_message) raise Exception(error_message)