Salome HOME
Merge remote-tracking branch 'origin/ngo/macros'
authormpv <mpv@opencascade.com>
Thu, 17 Oct 2019 07:06:22 +0000 (10:06 +0300)
committermpv <mpv@opencascade.com>
Thu, 17 Oct 2019 07:06:22 +0000 (10:06 +0300)
1  2 
src/PythonAddons/Test/TestcompoundVertices.py
src/PythonAddons/macros/compoundVertices/feature.py
src/PythonAddons/macros/importParameters/importParameters.txt

index 0000000000000000000000000000000000000000,05d3b2a2e3bb77e478754070c4b54cb5513a0241..697225c9fda8b7c0bb6ea1c7a7fba54fefbc1d46
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,51 +1,50 @@@
 -
+ # Copyright (C) 2014-2019  CEA/DEN, 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
+ # License as published by the Free Software Foundation; either
+ # version 2.1 of the License, or (at your option) any later version.
+ #
+ # This library is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this library; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ #
+ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+ #
+ from salome.shaper import model
+ from salome.shaper import geom
+ from ModelAPI import *
+ import os
+ aSession = ModelAPI_Session.get()
+ def getFilePath(fileName):
+     path = os.path.join(os.getenv("SHAPER_ROOT_DIR"), "bin", "salome", "macros", "compoundVertices")
+     return os.path.join(path, fileName)
+ theFile = getFilePath("compoundVertices.txt")
+ aSession.startOperation("Create part for import")
+ aPartFeature = aSession.moduleDocument().addFeature("Part")
+ aSession.finishOperation()
+ aPart = aSession.activeDocument()
+ aSession.startOperation("Import file")
+ aFeatureKind = "compoundVertices"
+ anImportFeature = aPart.addFeature(aFeatureKind)
+ aFieldName = "file_path"
+ file = anImportFeature.string(aFieldName)
+ file.setValue(theFile)
+ aSeparatorName = "separator"
+ separator = anImportFeature.string(aSeparatorName)
+ separator.setValue(" ")
+ aSession.finishOperation()
index 0000000000000000000000000000000000000000,c5babe823b424deb381a2849f76f2bf256e8753c..a6d7d258dd725447ac2e93c9033cf987a0058d7d
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,4 +1,3 @@@
 -
+ a 10
+ b 12
+ c 15