From 68942c34e31cd9bdd5009cfd868e67bb0c37cd19 Mon Sep 17 00:00:00 2001 From: mpa Date: Tue, 19 Nov 2013 11:23:26 +0000 Subject: [PATCH] - Modifing Geometry and Mesh Python scripts from SALOME 6 and before --- src/KERNEL_PY/kernel/services.py | 8 +++++--- src/KERNEL_PY/salome_test.py | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/KERNEL_PY/kernel/services.py b/src/KERNEL_PY/kernel/services.py index cddfa1f5f..5b15af882 100644 --- a/src/KERNEL_PY/kernel/services.py +++ b/src/KERNEL_PY/kernel/services.py @@ -222,10 +222,12 @@ def TEST_getComponentList(): def TEST_createObject(): """ - WARNING: for this test, we need GEOM (used to create an object + WARNING: for this test, we need GEOM (used to create an object) """ - import geompy - geompy.init_geom(salome.myStudy) + import GEOM + from salome.geom import geomBuilder + geompy = geomBuilder.New(salome.myStudy) + box = geompy.MakeBoxDXDYDZ(200, 200, 200) id = geompy.addToStudy( box, 'box' ) return id diff --git a/src/KERNEL_PY/salome_test.py b/src/KERNEL_PY/salome_test.py index b9c520a4b..8035aa410 100755 --- a/src/KERNEL_PY/salome_test.py +++ b/src/KERNEL_PY/salome_test.py @@ -171,15 +171,16 @@ print "======================================================================" print " %d. Test Mesh " % step; step+=1 print "======================================================================" -import StdMeshers +from salome.StdMeshers import StdMeshersBuilder import SMESH +from salome.smesh import smeshBuilder smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") if salome.hasDesktop(): smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId); else: - smesh.SetCurrentStudy(salome.myStudy) + smesh = smeshBuilder.New(salome.myStudy) # ---- create hypotheses -- 2.39.2