From: rnv Date: Wed, 15 May 2019 08:47:21 +0000 (+0300) Subject: Fix for "16925 [CEA 16749] MeshCut Python exception with Windows" issue. X-Git-Tag: V9_4_0a1~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=94ab6b047ca4c5374c092428501f408b51b0596b;p=modules%2Fsmesh.git Fix for "16925 [CEA 16749] MeshCut Python exception with Windows" issue. --- diff --git a/src/Tools/MeshCut/meshcut_plugin.py b/src/Tools/MeshCut/meshcut_plugin.py index 1aac3b4b7..53e048c90 100644 --- a/src/Tools/MeshCut/meshcut_plugin.py +++ b/src/Tools/MeshCut/meshcut_plugin.py @@ -20,6 +20,8 @@ # if you already have plugins defined in a salome_plugins.py file, add this file at the end. # if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py +import sys + def MeshCut(context): # get context study, salomeGui study = context.study @@ -96,11 +98,18 @@ and T the tolerance. if result: # dialog accepted args = ['MeshCut'] - args += [str(window.ui.le_origMeshFile.text()).encode()] - args += [str(window.ui.le_cutMeshFile.text()).encode()] - args += [str(window.ui.le_outMeshName.text()).encode()] - args += [str(window.ui.le_groupAbove.text()).encode()] - args += [str(window.ui.le_groupBelow.text()).encode()] + if sys.platform == "win32": + args += [str(window.ui.le_origMeshFile.text())] + args += [str(window.ui.le_cutMeshFile.text())] + args += [str(window.ui.le_outMeshName.text())] + args += [str(window.ui.le_groupAbove.text())] + args += [str(window.ui.le_groupBelow.text())] + else: + args += [str(window.ui.le_origMeshFile.text()).encode()] + args += [str(window.ui.le_cutMeshFile.text()).encode()] + args += [str(window.ui.le_outMeshName.text()).encode()] + args += [str(window.ui.le_groupAbove.text()).encode()] + args += [str(window.ui.le_groupBelow.text()).encode()] args += [str(window.ui.dsb_normX.value())] args += [str(window.ui.dsb_normY.value())] args += [str(window.ui.dsb_normZ.value())]