From fd10984242e300314708d87ebf67c3757d7e7a1b Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Tue, 13 Sep 2016 19:31:45 +0100 Subject: [PATCH] FEM: make use of new pref for standard location of ccx on Windows OS --- src/Mod/Fem/FemToolsCcx.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/Mod/Fem/FemToolsCcx.py b/src/Mod/Fem/FemToolsCcx.py index 72c1cb72e..d19c15a4f 100644 --- a/src/Mod/Fem/FemToolsCcx.py +++ b/src/Mod/Fem/FemToolsCcx.py @@ -106,17 +106,24 @@ class FemToolsCcx(FemTools.FemTools): # @ccx_binary_sig expected output form ccx when run empty. Default value is "CalculiX.exe -i jobname" def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"): from platform import system - 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: - if system() == "Linux": - ccx_binary = "ccx" - elif system() == "Windows": - ccx_binary = FreeCAD.getHomePath() + "bin/ccx.exe" - else: - ccx_binary = "ccx" - self.ccx_binary = ccx_binary + ccx_std_location = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").GetBool("UseStandardCcxLocation", True) + if ccx_std_location: + if system() == "Windows": + ccx_path = FreeCAD.getHomePath() + "bin/ccx.exe" + FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx").SetString("ccxBinaryPath", ccx_path) + self.ccx_binary = ccx_path + else: + 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: + if system() == "Linux": + ccx_binary = "ccx" + elif system() == "Windows": + ccx_binary = FreeCAD.getHomePath() + "bin/ccx.exe" + else: + ccx_binary = "ccx" + self.ccx_binary = ccx_binary import subprocess startup_info = None