X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FMeshCut%2Fmeshcut_plugin.py;h=0ffefebc4aafa0334548bc800e81bebaa2e4698e;hp=65ba70410c3af48b87640bae6e2879c8b4486015;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hpb=96726c1eae9968fd792f9bbe2f03e57a79c13728 diff --git a/src/Tools/MeshCut/meshcut_plugin.py b/src/Tools/MeshCut/meshcut_plugin.py index 65ba70410..0ffefebc4 100644 --- a/src/Tools/MeshCut/meshcut_plugin.py +++ b/src/Tools/MeshCut/meshcut_plugin.py @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2016 EDF R&D +# Copyright (C) 2006-2022 EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -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 @@ -51,7 +53,7 @@ def MeshCut(context): self.ui.le_origMeshFile.setText(infile) insplit = os.path.splitext(str(infile).encode()) outfile = insplit[0] + '_cut'.encode() + insplit[1] - self.ui.le_cutMeshFile.setText(outfile) + self.ui.le_cutMeshFile.setText(outfile.decode()) pass def setOutputFile(self): @@ -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())]