diff --git a/doc/salome/examples/3dmesh.py b/doc/salome/examples/3dmesh.py index 47383fee9..04d6073bd 100644 --- a/doc/salome/examples/3dmesh.py +++ b/doc/salome/examples/3dmesh.py @@ -3,11 +3,11 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() ### # Geometry: an assembly of a box, a cylinder and a truncated cone diff --git a/doc/salome/examples/a3DmeshOnModified2Dmesh.py b/doc/salome/examples/a3DmeshOnModified2Dmesh.py index 5520d7afe..ae03906c8 100644 --- a/doc/salome/examples/a3DmeshOnModified2Dmesh.py +++ b/doc/salome/examples/a3DmeshOnModified2Dmesh.py @@ -2,7 +2,7 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() # This script demonstrates generation of 3D mesh basing on a modified 2D mesh # @@ -31,7 +31,7 @@ Sph_Face = geompy.GetInPlace(Cut_1, Sph_Face, isNewImplementation=True, theName= import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() Mesh_1 = smesh.Mesh(Cut_1) @@ -59,4 +59,4 @@ Mesh_1.Tetrahedron() Mesh_1.Compute() if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/cartesian_algo.py b/doc/salome/examples/cartesian_algo.py index e5651cb67..6472c053e 100644 --- a/doc/salome/examples/cartesian_algo.py +++ b/doc/salome/examples/cartesian_algo.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook diff --git a/doc/salome/examples/creating_meshes_ex01.py b/doc/salome/examples/creating_meshes_ex01.py index f328d0582..786758d5d 100644 --- a/doc/salome/examples/creating_meshes_ex01.py +++ b/doc/salome/examples/creating_meshes_ex01.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBox(0., 0., 0., 100., 200., 300.) diff --git a/doc/salome/examples/creating_meshes_ex02.py b/doc/salome/examples/creating_meshes_ex02.py index 230e67a00..522f72bf4 100644 --- a/doc/salome/examples/creating_meshes_ex02.py +++ b/doc/salome/examples/creating_meshes_ex02.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(10., 10., 10.) diff --git a/doc/salome/examples/creating_meshes_ex03.py b/doc/salome/examples/creating_meshes_ex03.py index 8687b8971..2fa762c3f 100644 --- a/doc/salome/examples/creating_meshes_ex03.py +++ b/doc/salome/examples/creating_meshes_ex03.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) [Face_1,Face_2,Face_3,Face_4,Face_5,Face_6] = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["FACE"]) diff --git a/doc/salome/examples/creating_meshes_ex04.py b/doc/salome/examples/creating_meshes_ex04.py index 82408d5a3..86b443481 100644 --- a/doc/salome/examples/creating_meshes_ex04.py +++ b/doc/salome/examples/creating_meshes_ex04.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() def PrintMeshInfo(theMesh): aMesh = theMesh.GetMesh() diff --git a/doc/salome/examples/creating_meshes_ex05.py b/doc/salome/examples/creating_meshes_ex05.py index ae1d073b4..5426b7294 100644 --- a/doc/salome/examples/creating_meshes_ex05.py +++ b/doc/salome/examples/creating_meshes_ex05.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBox(0., 0., 0., 100., 200., 300.) diff --git a/doc/salome/examples/creating_meshes_ex06.py b/doc/salome/examples/creating_meshes_ex06.py index 90fe2765e..3cc4dc102 100644 --- a/doc/salome/examples/creating_meshes_ex06.py +++ b/doc/salome/examples/creating_meshes_ex06.py @@ -8,11 +8,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import math @@ -84,7 +84,7 @@ geompy.DifferenceList(group_1, [group_1_box]) # Mesh the blocks with hexahedral # ------------------------------- -smesh.SetCurrentStudy(salome.myStudy) +smesh.UpdateStudy() def discretize(x, y, z, nbSeg, shape=blocks): vert = geompy.MakeVertex( x, y, z ) diff --git a/doc/salome/examples/creating_meshes_ex07.py b/doc/salome/examples/creating_meshes_ex07.py index 4ddb69702..db825507b 100644 --- a/doc/salome/examples/creating_meshes_ex07.py +++ b/doc/salome/examples/creating_meshes_ex07.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() ## create a bottom box Box_inf = geompy.MakeBox(0., 0., 0., 200., 200., 50.) @@ -39,7 +39,7 @@ geompy.addToStudy(Box_sup, "Box_sup") geompy.addToStudyInFather(Box_sup, Fsup2, "Fsup") geompy.addToStudyInFather(Box_sup, Finf2, "Finf") -smesh.SetCurrentStudy(salome.myStudy) +smesh.UpdateStudy() ## create a bottom mesh Mesh_inf = smesh.Mesh(Box_inf, "Mesh_inf") @@ -78,4 +78,4 @@ Compound2 = smesh.Concatenate([Mesh_inf, Mesh_sup], 1, 0, 1e-05, True, name='Compound with UniteGrps and GrpsOfAllElems') if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/creating_meshes_ex08.py b/doc/salome/examples/creating_meshes_ex08.py index 0cb4b229f..7fa7a7dcf 100644 --- a/doc/salome/examples/creating_meshes_ex08.py +++ b/doc/salome/examples/creating_meshes_ex08.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # make geometry of a box box = geompy.MakeBoxDXDYDZ(100,100,100) diff --git a/doc/salome/examples/defining_hypotheses_adaptive1d.py b/doc/salome/examples/defining_hypotheses_adaptive1d.py index 96e2fabfe..579d14de5 100644 --- a/doc/salome/examples/defining_hypotheses_adaptive1d.py +++ b/doc/salome/examples/defining_hypotheses_adaptive1d.py @@ -1,9 +1,9 @@ import salome, math salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() box = geompy.MakeBoxDXDYDZ( 100, 100, 100 ) diff --git a/doc/salome/examples/defining_hypotheses_ex01.py b/doc/salome/examples/defining_hypotheses_ex01.py index c9f02bc12..a4083ba49 100644 --- a/doc/salome/examples/defining_hypotheses_ex01.py +++ b/doc/salome/examples/defining_hypotheses_ex01.py @@ -4,10 +4,10 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(10., 10., 10.) diff --git a/doc/salome/examples/defining_hypotheses_ex02.py b/doc/salome/examples/defining_hypotheses_ex02.py index 572404569..9473354b3 100644 --- a/doc/salome/examples/defining_hypotheses_ex02.py +++ b/doc/salome/examples/defining_hypotheses_ex02.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a face from arc and straight segment px = geompy.MakeVertex(100., 0. , 0. ) diff --git a/doc/salome/examples/defining_hypotheses_ex03.py b/doc/salome/examples/defining_hypotheses_ex03.py index 05a984b77..3e0a5a7de 100644 --- a/doc/salome/examples/defining_hypotheses_ex03.py +++ b/doc/salome/examples/defining_hypotheses_ex03.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(10., 10., 10.) diff --git a/doc/salome/examples/defining_hypotheses_ex04.py b/doc/salome/examples/defining_hypotheses_ex04.py index 8ebddfc5c..c15e4421b 100644 --- a/doc/salome/examples/defining_hypotheses_ex04.py +++ b/doc/salome/examples/defining_hypotheses_ex04.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(10., 10., 10.) diff --git a/doc/salome/examples/defining_hypotheses_ex05.py b/doc/salome/examples/defining_hypotheses_ex05.py index 204496ce0..d99844718 100644 --- a/doc/salome/examples/defining_hypotheses_ex05.py +++ b/doc/salome/examples/defining_hypotheses_ex05.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a face px = geompy.MakeVertex(100., 0. , 0. ) diff --git a/doc/salome/examples/defining_hypotheses_ex06.py b/doc/salome/examples/defining_hypotheses_ex06.py index 495067aa6..0c8422333 100644 --- a/doc/salome/examples/defining_hypotheses_ex06.py +++ b/doc/salome/examples/defining_hypotheses_ex06.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a cylinder cyl = geompy.MakeCylinderRH(30., 50.) diff --git a/doc/salome/examples/defining_hypotheses_ex07.py b/doc/salome/examples/defining_hypotheses_ex07.py index 1630a9047..a8a8e9fd2 100644 --- a/doc/salome/examples/defining_hypotheses_ex07.py +++ b/doc/salome/examples/defining_hypotheses_ex07.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create sketchers sketcher1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW") diff --git a/doc/salome/examples/defining_hypotheses_ex08.py b/doc/salome/examples/defining_hypotheses_ex08.py index 3c877f3da..285eae2ad 100644 --- a/doc/salome/examples/defining_hypotheses_ex08.py +++ b/doc/salome/examples/defining_hypotheses_ex08.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box base = geompy.MakeSketcher("Sketcher:F 0 0:TT 10 0:TT 20 10:TT 0 10:WF", theName="F") diff --git a/doc/salome/examples/defining_hypotheses_ex09.py b/doc/salome/examples/defining_hypotheses_ex09.py index 8490a4b8c..6e86cc95e 100644 --- a/doc/salome/examples/defining_hypotheses_ex09.py +++ b/doc/salome/examples/defining_hypotheses_ex09.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(10., 10., 10.) diff --git a/doc/salome/examples/defining_hypotheses_ex10.py b/doc/salome/examples/defining_hypotheses_ex10.py index 6e6bf84bb..9fea80b14 100644 --- a/doc/salome/examples/defining_hypotheses_ex10.py +++ b/doc/salome/examples/defining_hypotheses_ex10.py @@ -6,11 +6,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # Prepare geometry diff --git a/doc/salome/examples/defining_hypotheses_ex11.py b/doc/salome/examples/defining_hypotheses_ex11.py index 2510ed6f0..a57d0781d 100644 --- a/doc/salome/examples/defining_hypotheses_ex11.py +++ b/doc/salome/examples/defining_hypotheses_ex11.py @@ -6,11 +6,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # Prepare geometry diff --git a/doc/salome/examples/defining_hypotheses_ex12.py b/doc/salome/examples/defining_hypotheses_ex12.py index 827c4c5e2..7ead18cbf 100644 --- a/doc/salome/examples/defining_hypotheses_ex12.py +++ b/doc/salome/examples/defining_hypotheses_ex12.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() from salome.StdMeshers import StdMeshersBuilder # Create face and explode it on edges diff --git a/doc/salome/examples/defining_hypotheses_ex13.py b/doc/salome/examples/defining_hypotheses_ex13.py index 339cd200d..0bcdcf60a 100644 --- a/doc/salome/examples/defining_hypotheses_ex13.py +++ b/doc/salome/examples/defining_hypotheses_ex13.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # Create face from the wire and add to study Face = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WF", [0, 0, 0, 1, 0, 0, 0, 0, 1]) diff --git a/doc/salome/examples/defining_hypotheses_ex14.py b/doc/salome/examples/defining_hypotheses_ex14.py index 3f55844cf..b0ef9f6af 100644 --- a/doc/salome/examples/defining_hypotheses_ex14.py +++ b/doc/salome/examples/defining_hypotheses_ex14.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # Get 1/4 part from the disk face. Box_1 = geompy.MakeBoxDXDYDZ(100, 100, 100) diff --git a/doc/salome/examples/defining_hypotheses_ex15.py b/doc/salome/examples/defining_hypotheses_ex15.py index 2e01e1b32..80b430e2a 100644 --- a/doc/salome/examples/defining_hypotheses_ex15.py +++ b/doc/salome/examples/defining_hypotheses_ex15.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() from salome.StdMeshers import StdMeshersBuilder # Make quadrangle face and explode it on edges. diff --git a/doc/salome/examples/defining_hypotheses_ex16.py b/doc/salome/examples/defining_hypotheses_ex16.py index ce11e3e40..575601f1e 100644 --- a/doc/salome/examples/defining_hypotheses_ex16.py +++ b/doc/salome/examples/defining_hypotheses_ex16.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # Make a patritioned box diff --git a/doc/salome/examples/defining_hypotheses_ex17.py b/doc/salome/examples/defining_hypotheses_ex17.py index 36d8f6c1f..f2b7d8c20 100644 --- a/doc/salome/examples/defining_hypotheses_ex17.py +++ b/doc/salome/examples/defining_hypotheses_ex17.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() X = geompy.MakeVectorDXDYDZ( 1,0,0 ) O = geompy.MakeVertex( 100,50,50 ) diff --git a/doc/salome/examples/filters_ex09.py b/doc/salome/examples/filters_ex09.py index 032d55ddd..d83edc6aa 100644 --- a/doc/salome/examples/filters_ex09.py +++ b/doc/salome/examples/filters_ex09.py @@ -4,9 +4,9 @@ import salome, SMESH salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create mesh face = geompy.MakeFaceHW(100, 100, 1, theName="quadrangle") diff --git a/doc/salome/examples/filters_ex10.py b/doc/salome/examples/filters_ex10.py index bf6f7419b..54b4367b0 100644 --- a/doc/salome/examples/filters_ex10.py +++ b/doc/salome/examples/filters_ex10.py @@ -4,9 +4,9 @@ import salome, SMESH salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create mesh face = geompy.MakeFaceHW(100, 100, 1) diff --git a/doc/salome/examples/filters_ex16.py b/doc/salome/examples/filters_ex16.py index bdca2d86a..c859a07f2 100644 --- a/doc/salome/examples/filters_ex16.py +++ b/doc/salome/examples/filters_ex16.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook # make a mesh on a box diff --git a/doc/salome/examples/filters_ex17.py b/doc/salome/examples/filters_ex17.py index 9dc01b49c..e10e27f88 100644 --- a/doc/salome/examples/filters_ex17.py +++ b/doc/salome/examples/filters_ex17.py @@ -3,10 +3,10 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # make a mesh on a box box = geompy.MakeBoxDXDYDZ(100,100,100) diff --git a/doc/salome/examples/filters_ex18.py b/doc/salome/examples/filters_ex18.py index 32950cc50..c53768a83 100644 --- a/doc/salome/examples/filters_ex18.py +++ b/doc/salome/examples/filters_ex18.py @@ -3,10 +3,10 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # make a mesh on a box box = geompy.MakeBoxDXDYDZ(100,100,100) diff --git a/doc/salome/examples/filters_ex39.py b/doc/salome/examples/filters_ex39.py index ebbb0b936..d367ab878 100644 --- a/doc/salome/examples/filters_ex39.py +++ b/doc/salome/examples/filters_ex39.py @@ -3,9 +3,9 @@ import salome, SMESH salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create two boxes to have two domains in the mesh diff --git a/doc/salome/examples/generate_flat_elements.py b/doc/salome/examples/generate_flat_elements.py index df187188b..b81d80155 100644 --- a/doc/salome/examples/generate_flat_elements.py +++ b/doc/salome/examples/generate_flat_elements.py @@ -8,11 +8,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # geometry diff --git a/doc/salome/examples/grouping_elements_ex01.py b/doc/salome/examples/grouping_elements_ex01.py index 0bb1b9a2f..d99f9b4ae 100644 --- a/doc/salome/examples/grouping_elements_ex01.py +++ b/doc/salome/examples/grouping_elements_ex01.py @@ -77,4 +77,4 @@ aGroup.Remove( [2,3,4] ) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/grouping_elements_ex02.py b/doc/salome/examples/grouping_elements_ex02.py index 841501253..4e2a4957f 100644 --- a/doc/salome/examples/grouping_elements_ex02.py +++ b/doc/salome/examples/grouping_elements_ex02.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBox(0., 0., 0., 100., 100., 100.) @@ -43,4 +43,4 @@ aSmeshGroup1 = quadra.GroupOnGeom(face, "SMESHGroup1") # create SMESH group on with default name aSmeshGroup2 = quadra.GroupOnGeom(aGeomGroupE) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/grouping_elements_ex03.py b/doc/salome/examples/grouping_elements_ex03.py index bd85e09e0..560f6a3fb 100644 --- a/doc/salome/examples/grouping_elements_ex03.py +++ b/doc/salome/examples/grouping_elements_ex03.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook @@ -46,4 +46,4 @@ filt2.SetCriteria( [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_RangeOfIds, "1-70" filtIDs3 = filtGroup.GetIDs() print "After filter modification, group on filter contains %s elemens" % filtGroup.Size() -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/grouping_elements_ex04.py b/doc/salome/examples/grouping_elements_ex04.py index 9beb77e36..a9b03ed0b 100644 --- a/doc/salome/examples/grouping_elements_ex04.py +++ b/doc/salome/examples/grouping_elements_ex04.py @@ -42,4 +42,4 @@ for i in range(len(aGroupElemIDs)): pass print "" -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/grouping_elements_ex05.py b/doc/salome/examples/grouping_elements_ex05.py index 047691b86..16c1f14ca 100644 --- a/doc/salome/examples/grouping_elements_ex05.py +++ b/doc/salome/examples/grouping_elements_ex05.py @@ -52,4 +52,4 @@ aGroup4.SetColor( SALOMEDS.Color(1.,0.,0.)); aGroup5 = mesh.UnionListOfGroups([aGroup3, aGroup4], "Any Area") print "Criterion: Any Area, Nb = ", len(aGroup5.GetListOfID()) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/grouping_elements_ex06.py b/doc/salome/examples/grouping_elements_ex06.py index bf9e3708b..2fc70fe6e 100644 --- a/doc/salome/examples/grouping_elements_ex06.py +++ b/doc/salome/examples/grouping_elements_ex06.py @@ -34,4 +34,4 @@ aGroup3 = mesh.IntersectListOfGroups([aGroup1, aGroup2], "20 < Area < 60") print "Criterion: 20 < Area < 60, Nb = ", len(aGroup3.GetListOfID()) # Please note that also there is IntersectGroups() method which works with two groups only -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/grouping_elements_ex07.py b/doc/salome/examples/grouping_elements_ex07.py index 1a79c5fe2..e0c7ab199 100644 --- a/doc/salome/examples/grouping_elements_ex07.py +++ b/doc/salome/examples/grouping_elements_ex07.py @@ -32,4 +32,4 @@ aGroupRes = mesh.CutGroups(aGroupMain, aGroupTool, "Area >= 60") print "Criterion: Area >= 60, Nb = ", len(aGroupRes.GetListOfID()) # Please note that also there is CutListOfGroups() method which works with lists of groups of any lengths -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/grouping_elements_ex08.py b/doc/salome/examples/grouping_elements_ex08.py index 459a50dc2..f53dcca69 100644 --- a/doc/salome/examples/grouping_elements_ex08.py +++ b/doc/salome/examples/grouping_elements_ex08.py @@ -30,4 +30,4 @@ aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.EDGE, "Edges" ) # Create group of nodes using source groups of faces aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.NODE, "Nodes" ) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/measurements_ex01.py b/doc/salome/examples/measurements_ex01.py index d8a5bd71c..b94f59cbb 100644 --- a/doc/salome/examples/measurements_ex01.py +++ b/doc/salome/examples/measurements_ex01.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook from SMESH_mechanic import mesh as mesh1 diff --git a/doc/salome/examples/measurements_ex02.py b/doc/salome/examples/measurements_ex02.py index b5fbf8b1f..a11a47dfb 100644 --- a/doc/salome/examples/measurements_ex02.py +++ b/doc/salome/examples/measurements_ex02.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook from SMESH_mechanic import mesh as mesh1 diff --git a/doc/salome/examples/measurements_ex03.py b/doc/salome/examples/measurements_ex03.py index 5a44cdaca..de4af2b55 100644 --- a/doc/salome/examples/measurements_ex03.py +++ b/doc/salome/examples/measurements_ex03.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBoxDXDYDZ(100,100,100) diff --git a/doc/salome/examples/modifying_meshes_ex01.py b/doc/salome/examples/modifying_meshes_ex01.py index 0ef07aa7a..b2594db97 100644 --- a/doc/salome/examples/modifying_meshes_ex01.py +++ b/doc/salome/examples/modifying_meshes_ex01.py @@ -4,7 +4,7 @@ import salome salome.salome_init() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() mesh = smesh.Mesh() diff --git a/doc/salome/examples/modifying_meshes_ex02.py b/doc/salome/examples/modifying_meshes_ex02.py index 7948ed3dc..64a783a27 100644 --- a/doc/salome/examples/modifying_meshes_ex02.py +++ b/doc/salome/examples/modifying_meshes_ex02.py @@ -4,7 +4,7 @@ import salome salome.salome_init() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() mesh = smesh.Mesh() diff --git a/doc/salome/examples/modifying_meshes_ex03.py b/doc/salome/examples/modifying_meshes_ex03.py index 0c6bc61dd..8918b8320 100644 --- a/doc/salome/examples/modifying_meshes_ex03.py +++ b/doc/salome/examples/modifying_meshes_ex03.py @@ -5,11 +5,11 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a geometry diff --git a/doc/salome/examples/modifying_meshes_ex09.py b/doc/salome/examples/modifying_meshes_ex09.py index c09cb62c6..401fda8d6 100644 --- a/doc/salome/examples/modifying_meshes_ex09.py +++ b/doc/salome/examples/modifying_meshes_ex09.py @@ -7,7 +7,7 @@ salome.salome_init() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create an empty mesh structure @@ -34,4 +34,4 @@ f1 = MakePolygon(mesh, 0, 0, 0, 30, 13) f2 = MakePolygon(mesh, 0, 0, 10, 21, 9) f3 = MakePolygon(mesh, 0, 0, 20, 13, 6) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex10.py b/doc/salome/examples/modifying_meshes_ex10.py index bf13423ed..fe8ec68c6 100644 --- a/doc/salome/examples/modifying_meshes_ex10.py +++ b/doc/salome/examples/modifying_meshes_ex10.py @@ -5,7 +5,7 @@ import salome salome.salome_init() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import math @@ -60,4 +60,4 @@ mesh.AddPolyhedralVolume([dd[0], dd[1], dd[2], dd[3], dd[4], # top [5,5,5,5,5,5,5,5,5,5,5,5]) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(True) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex15.py b/doc/salome/examples/modifying_meshes_ex15.py index 5985c0844..22aba54cc 100644 --- a/doc/salome/examples/modifying_meshes_ex15.py +++ b/doc/salome/examples/modifying_meshes_ex15.py @@ -5,11 +5,11 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() box = geompy.MakeBoxDXDYDZ(200, 200, 200) diff --git a/doc/salome/examples/modifying_meshes_ex16.py b/doc/salome/examples/modifying_meshes_ex16.py index 0786445eb..280527223 100644 --- a/doc/salome/examples/modifying_meshes_ex16.py +++ b/doc/salome/examples/modifying_meshes_ex16.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook @@ -51,4 +51,4 @@ res = mesh.InverseDiag(bb[1], tt[2]) if not res: print "failed!" else: print "done." -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex17.py b/doc/salome/examples/modifying_meshes_ex17.py index ebeb247a8..939278143 100644 --- a/doc/salome/examples/modifying_meshes_ex17.py +++ b/doc/salome/examples/modifying_meshes_ex17.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook @@ -51,4 +51,4 @@ res = mesh.DeleteDiag(bb[1], tt[2]) if not res: print "failed!" else: print "done." -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex18.py b/doc/salome/examples/modifying_meshes_ex18.py index 458b0fe25..d6256cdc1 100644 --- a/doc/salome/examples/modifying_meshes_ex18.py +++ b/doc/salome/examples/modifying_meshes_ex18.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook @@ -51,4 +51,4 @@ res = mesh.TriToQuad([ff[2], ff[3], ff[4], ff[5]], SMESH.FT_MinimumAngle, 60.) if not res: print "failed!" else: print "done." -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex19.py b/doc/salome/examples/modifying_meshes_ex19.py index 8ef2c7c8a..7e3c723c5 100644 --- a/doc/salome/examples/modifying_meshes_ex19.py +++ b/doc/salome/examples/modifying_meshes_ex19.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook @@ -42,4 +42,4 @@ f5 = mesh.AddFace([n5, n6, n12, n11]) # Change the orientation of the second and the fourth faces. mesh.Reorient([2, 4]) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex21.py b/doc/salome/examples/modifying_meshes_ex21.py index 650d998e5..a6d108bc2 100644 --- a/doc/salome/examples/modifying_meshes_ex21.py +++ b/doc/salome/examples/modifying_meshes_ex21.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import SMESH_mechanic @@ -32,4 +32,4 @@ print "\nSmoothing ... ", if not res: print "failed!" else: print "done." -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex22.py b/doc/salome/examples/modifying_meshes_ex22.py index b4f5f3cd3..32466ccf0 100644 --- a/doc/salome/examples/modifying_meshes_ex22.py +++ b/doc/salome/examples/modifying_meshes_ex22.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import SMESH_mechanic @@ -31,4 +31,4 @@ GroupTri = mesh.GroupOnGeom(face, "Group of faces (extrusion)", SMESH.FACE) # perform extrusion of the group mesh.ExtrusionSweepObject(GroupTri, vector, 5) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex23.py b/doc/salome/examples/modifying_meshes_ex23.py index 3db2c3e12..05e699c46 100644 --- a/doc/salome/examples/modifying_meshes_ex23.py +++ b/doc/salome/examples/modifying_meshes_ex23.py @@ -6,11 +6,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # 1. Create points points = [[0, 0], [50, 30], [50, 110], [0, 150], [-80, 150], [-130, 70], [-130, -20]] @@ -128,4 +128,4 @@ error = quad_6.ExtrusionAlongPath(ff_6 , Edge_Circle_mesh, Edge_Circle, 1, error = quad_7.ExtrusionAlongPath(ff_7, Edge_Circle_mesh, Edge_Circle, 1, 1, [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/modifying_meshes_ex25.py b/doc/salome/examples/modifying_meshes_ex25.py index 4072560c4..ad3ac4565 100644 --- a/doc/salome/examples/modifying_meshes_ex25.py +++ b/doc/salome/examples/modifying_meshes_ex25.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # define the geometry Box_1 = geompy.MakeBoxDXDYDZ(200., 200., 200.) diff --git a/doc/salome/examples/modifying_meshes_ex26.py b/doc/salome/examples/modifying_meshes_ex26.py index 4a8eba75e..53059ff96 100644 --- a/doc/salome/examples/modifying_meshes_ex26.py +++ b/doc/salome/examples/modifying_meshes_ex26.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create sphere of radius 100 diff --git a/doc/salome/examples/notebook_smesh.py b/doc/salome/examples/notebook_smesh.py index e52ef1b54..376e51163 100644 --- a/doc/salome/examples/notebook_smesh.py +++ b/doc/salome/examples/notebook_smesh.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook # set variables diff --git a/doc/salome/examples/prism_3d_algo.py b/doc/salome/examples/prism_3d_algo.py index 5aa283edf..6c2a9d6d4 100644 --- a/doc/salome/examples/prism_3d_algo.py +++ b/doc/salome/examples/prism_3d_algo.py @@ -4,11 +4,11 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() OX = geompy.MakeVectorDXDYDZ(1,0,0) OY = geompy.MakeVectorDXDYDZ(0,1,0) diff --git a/doc/salome/examples/quality_controls_ex01.py b/doc/salome/examples/quality_controls_ex01.py index 6990aa66b..8b869e67c 100644 --- a/doc/salome/examples/quality_controls_ex01.py +++ b/doc/salome/examples/quality_controls_ex01.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create open shell: a box without one plane box = geompy.MakeBox(0., 0., 0., 20., 20., 15.) @@ -44,4 +44,4 @@ print "" aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Free borders") aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex02.py b/doc/salome/examples/quality_controls_ex02.py index c2fc56f86..f1c1943be 100644 --- a/doc/salome/examples/quality_controls_ex02.py +++ b/doc/salome/examples/quality_controls_ex02.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create open shell: a box without one plane box = geompy.MakeBox(0., 0., 0., 20., 20., 15.) @@ -46,4 +46,4 @@ print "" aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Borders at multi-connections") aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex03.py b/doc/salome/examples/quality_controls_ex03.py index 7c5a804f5..6ac5410e7 100644 --- a/doc/salome/examples/quality_controls_ex03.py +++ b/doc/salome/examples/quality_controls_ex03.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create open shell: a box without one plane box = geompy.MakeBox(0., 0., 0., 20., 20., 15.) @@ -46,4 +46,4 @@ print "" aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex04.py b/doc/salome/examples/quality_controls_ex04.py index 373ddbe02..9d902f5b0 100644 --- a/doc/salome/examples/quality_controls_ex04.py +++ b/doc/salome/examples/quality_controls_ex04.py @@ -37,4 +37,4 @@ for i in range(len(aBorders)): aGroupF.Add([aBorder.myElemId]) aGroupN.Add([aBorder.myPnt1, aBorder.myPnt2]) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex05.py b/doc/salome/examples/quality_controls_ex05.py index cbd217839..bf6d7fa4c 100644 --- a/doc/salome/examples/quality_controls_ex05.py +++ b/doc/salome/examples/quality_controls_ex05.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create box box = geompy.MakeBox(0., 0., 0., 100., 200., 300.) @@ -51,4 +51,4 @@ for i in range(len(anNodeIds)): pass print "" -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex06.py b/doc/salome/examples/quality_controls_ex06.py index 1bd007bf6..6df90c0c9 100644 --- a/doc/salome/examples/quality_controls_ex06.py +++ b/doc/salome/examples/quality_controls_ex06.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() ####### GEOM part ######## @@ -75,4 +75,4 @@ aFaceIds = Mesh_1.GetIdsFromFilter(aFilter) aGroup = Mesh_1.CreateEmptyGroup(SMESH.FACE, "Shared_faces") aGroup.Add(aFaceIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex07.py b/doc/salome/examples/quality_controls_ex07.py index 5e84f2bfc..e85b27d73 100644 --- a/doc/salome/examples/quality_controls_ex07.py +++ b/doc/salome/examples/quality_controls_ex07.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook diff --git a/doc/salome/examples/quality_controls_ex08.py b/doc/salome/examples/quality_controls_ex08.py index 541af64a3..8a98910e5 100644 --- a/doc/salome/examples/quality_controls_ex08.py +++ b/doc/salome/examples/quality_controls_ex08.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook diff --git a/doc/salome/examples/quality_controls_ex09.py b/doc/salome/examples/quality_controls_ex09.py index aca903ae0..82050cbc0 100644 --- a/doc/salome/examples/quality_controls_ex09.py +++ b/doc/salome/examples/quality_controls_ex09.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook diff --git a/doc/salome/examples/quality_controls_ex10.py b/doc/salome/examples/quality_controls_ex10.py index 041183224..1a4287fc7 100644 --- a/doc/salome/examples/quality_controls_ex10.py +++ b/doc/salome/examples/quality_controls_ex10.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook diff --git a/doc/salome/examples/quality_controls_ex11.py b/doc/salome/examples/quality_controls_ex11.py index b0b5e3f24..dffd85ca2 100644 --- a/doc/salome/examples/quality_controls_ex11.py +++ b/doc/salome/examples/quality_controls_ex11.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create open shell: a box without one plane box = geompy.MakeBox(0., 0., 0., 20., 20., 15.) @@ -47,4 +47,4 @@ print "" aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Faces with length 2D > " + `length_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex12.py b/doc/salome/examples/quality_controls_ex12.py index ba6fb9d7d..77027c2f5 100644 --- a/doc/salome/examples/quality_controls_ex12.py +++ b/doc/salome/examples/quality_controls_ex12.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a compound of two glued boxes box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.) @@ -47,4 +47,4 @@ print "" aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Borders at multi-connection 2D = " + `nb_conn`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex13.py b/doc/salome/examples/quality_controls_ex13.py index 3b52dbc12..82070ac3b 100644 --- a/doc/salome/examples/quality_controls_ex13.py +++ b/doc/salome/examples/quality_controls_ex13.py @@ -28,4 +28,4 @@ print "" aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Area > " + `area_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex14.py b/doc/salome/examples/quality_controls_ex14.py index b66d9413a..eb6f844ef 100644 --- a/doc/salome/examples/quality_controls_ex14.py +++ b/doc/salome/examples/quality_controls_ex14.py @@ -28,4 +28,4 @@ print "" aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Taper > " + `taper_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex15.py b/doc/salome/examples/quality_controls_ex15.py index 0aeedbfa8..4bc47d2e1 100644 --- a/doc/salome/examples/quality_controls_ex15.py +++ b/doc/salome/examples/quality_controls_ex15.py @@ -28,4 +28,4 @@ print "" aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Aspect Ratio > " + `ar_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex16.py b/doc/salome/examples/quality_controls_ex16.py index e80e91f48..65bac0606 100644 --- a/doc/salome/examples/quality_controls_ex16.py +++ b/doc/salome/examples/quality_controls_ex16.py @@ -29,4 +29,4 @@ aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Minimum Angle < " + `min_angle`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex17.py b/doc/salome/examples/quality_controls_ex17.py index 8f7f39c48..75566f416 100644 --- a/doc/salome/examples/quality_controls_ex17.py +++ b/doc/salome/examples/quality_controls_ex17.py @@ -29,4 +29,4 @@ aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Warp > " + `wa_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex18.py b/doc/salome/examples/quality_controls_ex18.py index ad6dff185..431557e6e 100644 --- a/doc/salome/examples/quality_controls_ex18.py +++ b/doc/salome/examples/quality_controls_ex18.py @@ -28,4 +28,4 @@ print "" aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Skew > " + `skew_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex19.py b/doc/salome/examples/quality_controls_ex19.py index 814cb5ba5..19b680f29 100644 --- a/doc/salome/examples/quality_controls_ex19.py +++ b/doc/salome/examples/quality_controls_ex19.py @@ -28,4 +28,4 @@ print "" aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Element Diameter 2D > " + `mel_2d_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex20.py b/doc/salome/examples/quality_controls_ex20.py index 3a7c44f94..f0a7bccf0 100644 --- a/doc/salome/examples/quality_controls_ex20.py +++ b/doc/salome/examples/quality_controls_ex20.py @@ -29,4 +29,4 @@ aGroup = mesh.CreateEmptyGroup(SMESH.VOLUME, "Aspect Ratio 3D > " + `ar_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex21.py b/doc/salome/examples/quality_controls_ex21.py index 1f27eef3a..e64e2fb55 100644 --- a/doc/salome/examples/quality_controls_ex21.py +++ b/doc/salome/examples/quality_controls_ex21.py @@ -30,4 +30,4 @@ aGroup = mesh.CreateEmptyGroup(SMESH.VOLUME, "Volume < " + `volume_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/quality_controls_ex22.py b/doc/salome/examples/quality_controls_ex22.py index e43e5c1b8..15335f979 100644 --- a/doc/salome/examples/quality_controls_ex22.py +++ b/doc/salome/examples/quality_controls_ex22.py @@ -28,4 +28,4 @@ print "" aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Element Diameter 3D > " + `mel_3d_margin`) aGroup.Add(anIds) -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/split_biquad.py b/doc/salome/examples/split_biquad.py index e53e7b0b1..235d49157 100644 --- a/doc/salome/examples/split_biquad.py +++ b/doc/salome/examples/split_biquad.py @@ -4,10 +4,10 @@ import salome salome.salome_init() from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # make a shape consisting of two quadranges OY = geompy.MakeVectorDXDYDZ(0, 1, 0) diff --git a/doc/salome/examples/transforming_meshes_ex03.py b/doc/salome/examples/transforming_meshes_ex03.py index a6f7701f8..8184e2450 100644 --- a/doc/salome/examples/transforming_meshes_ex03.py +++ b/doc/salome/examples/transforming_meshes_ex03.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() Box = geompy.MakeBoxDXDYDZ(200, 200, 200) f = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"]) diff --git a/doc/salome/examples/transforming_meshes_ex06.py b/doc/salome/examples/transforming_meshes_ex06.py index 47c25b1ea..36cf38544 100644 --- a/doc/salome/examples/transforming_meshes_ex06.py +++ b/doc/salome/examples/transforming_meshes_ex06.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a face to be meshed px = geompy.MakeVertex(100., 0. , 0. ) @@ -77,4 +77,4 @@ print "Triangles : ", trias.NbTriangles() print "Quadrangles: ", trias.NbQuadrangles() print "Volumes : ", trias.NbVolumes() -salome.sg.updateObjBrowser(True) +salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/transforming_meshes_ex07.py b/doc/salome/examples/transforming_meshes_ex07.py index 227eb636e..f14c2ca62 100644 --- a/doc/salome/examples/transforming_meshes_ex07.py +++ b/doc/salome/examples/transforming_meshes_ex07.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create two faces of a box box1 = geompy.MakeBox(0., 0., -10., 30., 20., 25.) diff --git a/doc/salome/examples/transforming_meshes_ex08.py b/doc/salome/examples/transforming_meshes_ex08.py index 77042de99..b593e0ef1 100644 --- a/doc/salome/examples/transforming_meshes_ex08.py +++ b/doc/salome/examples/transforming_meshes_ex08.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook diff --git a/doc/salome/examples/transforming_meshes_ex09.py b/doc/salome/examples/transforming_meshes_ex09.py index 9264a5c4c..6caccd105 100644 --- a/doc/salome/examples/transforming_meshes_ex09.py +++ b/doc/salome/examples/transforming_meshes_ex09.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # make two not sewed quadranges OY0 = geompy.MakeVectorDXDYDZ(0, 1, 0) diff --git a/doc/salome/examples/transforming_meshes_ex10.py b/doc/salome/examples/transforming_meshes_ex10.py index e0120b481..5ff16d470 100644 --- a/doc/salome/examples/transforming_meshes_ex10.py +++ b/doc/salome/examples/transforming_meshes_ex10.py @@ -4,11 +4,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create two boxes box1 = geompy.MakeBox(0., 0., 0., 10., 10., 10.) diff --git a/doc/salome/examples/transforming_meshes_ex11.py b/doc/salome/examples/transforming_meshes_ex11.py index 0abe52013..db0d24d62 100644 --- a/doc/salome/examples/transforming_meshes_ex11.py +++ b/doc/salome/examples/transforming_meshes_ex11.py @@ -6,11 +6,11 @@ salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # Create a box @@ -92,4 +92,4 @@ mesh.DoubleElements([ 1, 2 ]) # Update object browser if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(False) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/transforming_meshes_ex12.py b/doc/salome/examples/transforming_meshes_ex12.py index e1d850ec6..a8c9a58af 100644 --- a/doc/salome/examples/transforming_meshes_ex12.py +++ b/doc/salome/examples/transforming_meshes_ex12.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook diff --git a/doc/salome/examples/transforming_meshes_ex13.py b/doc/salome/examples/transforming_meshes_ex13.py index 37a3f5eed..bbdac2562 100644 --- a/doc/salome/examples/transforming_meshes_ex13.py +++ b/doc/salome/examples/transforming_meshes_ex13.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook diff --git a/doc/salome/examples/use_existing_faces.py b/doc/salome/examples/use_existing_faces.py index c4b95fdaf..1af8322e3 100644 --- a/doc/salome/examples/use_existing_faces.py +++ b/doc/salome/examples/use_existing_faces.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() import salome_notebook import numpy as np diff --git a/doc/salome/examples/viewing_meshes_ex01.py b/doc/salome/examples/viewing_meshes_ex01.py index 85bc69fbc..9a3c48528 100644 --- a/doc/salome/examples/viewing_meshes_ex01.py +++ b/doc/salome/examples/viewing_meshes_ex01.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # create a box box = geompy.MakeBox(0., 0., 0., 20., 20., 20.) diff --git a/doc/salome/examples/viewing_meshes_ex02.py b/doc/salome/examples/viewing_meshes_ex02.py index 2ed0a214b..0dfa09a85 100644 --- a/doc/salome/examples/viewing_meshes_ex02.py +++ b/doc/salome/examples/viewing_meshes_ex02.py @@ -5,11 +5,11 @@ import salome salome.salome_init() import GEOM from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) +geompy = geomBuilder.New() import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() # Create a geometry to mesh box = geompy.MakeBoxDXDYDZ(100,100,100) diff --git a/doc/salome/gui/SMESH/input/smesh_migration.doc b/doc/salome/gui/SMESH/input/smesh_migration.doc index 3713fae37..cf0181758 100644 --- a/doc/salome/gui/SMESH/input/smesh_migration.doc +++ b/doc/salome/gui/SMESH/input/smesh_migration.doc @@ -20,13 +20,13 @@ salome.salome_init() \n the old mode (from dump): \code import smesh, SMESH, SALOMEDS -smesh.SetCurrentStudy(salome.myStudy) +smesh.UpdateStudy() \endcode \n the new mode: \code import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(salome.myStudy) +smesh = smeshBuilder.New() \endcode diff --git a/doc/salome/gui/SMESH/input/smeshpy_interface.doc b/doc/salome/gui/SMESH/input/smeshpy_interface.doc index 524a4ceb0..5a24ee76c 100644 --- a/doc/salome/gui/SMESH/input/smeshpy_interface.doc +++ b/doc/salome/gui/SMESH/input/smeshpy_interface.doc @@ -28,7 +28,7 @@ A usual workflow to generate a mesh on geometry is following:
  • Create an instance of \ref smeshBuilder.smeshBuilder "smeshBuilder":
           from salome.smesh import smeshBuilder
    -      smesh = smeshBuilder.New( salome.myStudy )
    +      smesh = smeshBuilder.New()
         
  • Create a \ref smeshBuilder.Mesh "mesh" object:
    diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl
    index 75fbe0894..dc9433346 100644
    --- a/idl/SMESH_Gen.idl
    +++ b/idl/SMESH_Gen.idl
    @@ -139,14 +139,19 @@ module SMESH
         boolean IsEmbeddedMode();
     
         /*!
    -      Set the current study
    +      Update the study
          */
    -    void SetCurrentStudy( in SALOMEDS::Study theStudy );
    -
    +    void UpdateStudy();
    +    
         /*!
    -      Get the current study
    +      Set enable publishing in the study
          */
    -    SALOMEDS::Study GetCurrentStudy();
    +    void SetEnablePublish( in boolean theIsEnablePublish );
    +    
    +    /*!
    +      Get enable publishing in the study
    +     */
    +    boolean IsEnablePublish();
     
         /*!
          * Create a hypothesis that can be shared by differents parts of the mesh.
    diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl
    index cef3831ee..7c506aacc 100644
    --- a/idl/SMESH_Mesh.idl
    +++ b/idl/SMESH_Mesh.idl
    @@ -597,11 +597,6 @@ module SMESH
          */
         long GetId();
     
    -    /*!
    -     * Get the study Id
    -     */
    -    long GetStudyId();
    -
         /*!
          * Obtain instance of SMESH_MeshEditor
          */
    diff --git a/resources/SMESHCatalog.xml.in b/resources/SMESHCatalog.xml.in
    index a1d573d7f..3e18f1535 100644
    --- a/resources/SMESHCatalog.xml.in
    +++ b/resources/SMESHCatalog.xml.in
    @@ -65,14 +65,9 @@
                 0
                 
                   
    -		string
    -		anHyp
    -		
    -              
    -              
    -		long
    -		studyId
    -		
    +                string
    +                anHyp
    +                
                   
                 
                 
    @@ -95,11 +90,6 @@
                   geomEngine
                   
                 
    -            
    -              long
    -              studyId
    -              
    -            
                 
                   GEOM/GEOM_Object
                   aShape
    diff --git a/src/PluginUtils/GeomSelectionTools.cxx b/src/PluginUtils/GeomSelectionTools.cxx
    index 0a9be9309..32240fb47 100644
    --- a/src/PluginUtils/GeomSelectionTools.cxx
    +++ b/src/PluginUtils/GeomSelectionTools.cxx
    @@ -45,21 +45,10 @@
     
     /*!
      * Constructor
    - * @param aStudy pointer to the Study
      *
      */
    -GeomSelectionTools::GeomSelectionTools(_PTR(Study) aStudy)
    +GeomSelectionTools::GeomSelectionTools()
     {
    -  myStudy = aStudy;
    -}
    -
    -/*!
    - * Accessor to the Study used by this GeomSelectionTools object
    - * @return The study used by the GeomSelectionTools class
    - */
    -_PTR(Study) GeomSelectionTools::getMyStudy()
    -{
    -    return myStudy;
     }
     
     /*!
    @@ -137,7 +126,7 @@ std::string GeomSelectionTools::getFirstSelectedEntry()
      */
     std::string GeomSelectionTools::getEntryOfObject(Handle(SALOME_InteractiveObject) anIO){
       std::string entry="";
    -  _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
    +  _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(anIO->getEntry());
       if (aSO){
         _PTR(SObject) aRefSObj;
         // If selected object is a reference
    @@ -157,7 +146,7 @@ std::string GeomSelectionTools::getEntryOfObject(Handle(SALOME_InteractiveObject
      */
     std::string GeomSelectionTools::getNameFromEntry(std::string entry){
       std::string name = "";
    -  _PTR(SObject) aSO = myStudy->FindObjectID(entry);
    +  _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(entry);
       if (aSO){
         _PTR(SObject) aRefSObj;
         // If selected object is a reference
    @@ -180,7 +169,7 @@ std::string GeomSelectionTools::getFirstSelectedComponentDataType()
       Handle(SALOME_InteractiveObject) anIO;
       std::string DataType="";
       anIO=GeomSelectionTools::getFirstSelectedSalomeObject();
    -  _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
    +  _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(anIO->getEntry());
       if (aSO){
         _PTR(SObject) aRefSObj;
         // If selected object is a reference
    @@ -201,7 +190,7 @@ TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){
     //   MESSAGE("GeomSelectionTools::entryToShapeType"<FindObjectID(entry);
    +   _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(entry);
       if (aSO){
         _PTR(SObject) aRefSObj;
         GEOM::GEOM_Object_var aShape;
    @@ -225,7 +214,7 @@ TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){
             if (aShape->GetType() == GEOM_GROUP){
     //           MESSAGE("It's a group");
               GEOM::GEOM_IGroupOperations_wrap aGroupOp =
    -            _geomEngine->GetIGroupOperations(myStudy->StudyId());
    +            _geomEngine->GetIGroupOperations();
               ShapeType= (TopAbs_ShapeEnum)aGroupOp->GetType(aShape);
             }
             // if not
    diff --git a/src/PluginUtils/GeomSelectionTools.h b/src/PluginUtils/GeomSelectionTools.h
    index c4013ff99..0fc4cbaf3 100644
    --- a/src/PluginUtils/GeomSelectionTools.h
    +++ b/src/PluginUtils/GeomSelectionTools.h
    @@ -49,13 +49,9 @@ class LightApp_SelectionMgr;
     class PLUGINUTILS_EXPORT GeomSelectionTools
     {
     
    -private:
    -
    -  _PTR(Study) myStudy;
    -
     public:
     
    -  GeomSelectionTools(_PTR(Study));
    +  GeomSelectionTools();
       static SalomeApp_Application*  GetSalomeApplication();
       static LightApp_SelectionMgr* selectionMgr();
       SALOME_ListIO* getSelectedSalomeObjects();
    @@ -67,7 +63,6 @@ public:
       TopAbs_ShapeEnum getFirstSelectedShapeType();
       TopAbs_ShapeEnum entryToShapeType(std::string );
       GeomAbs_SurfaceType getFaceInformation(TopoDS_Shape);
    -  _PTR(Study) getMyStudy();
     };
     
     //////////////////////////////////////////
    diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx
    index 4e4002ee3..c4fbb42cf 100644
    --- a/src/SMESH/SMESH_Algo.cxx
    +++ b/src/SMESH/SMESH_Algo.cxx
    @@ -175,8 +175,8 @@ const SMESH_Algo::Features& SMESH_Algo::GetFeatures( const std::string& algoType
      */
     //=============================================================================
     
    -SMESH_Algo::SMESH_Algo (int hypId, int studyId, SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +SMESH_Algo::SMESH_Algo (int hypId, SMESH_Gen * gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _compatibleAllHypFilter = _compatibleNoAuxHypFilter = NULL;
       _onlyUnaryInput = _requireDiscreteBoundary = _requireShape = true;
    @@ -204,26 +204,26 @@ SMESH_Algo::~SMESH_Algo()
      */
     //=============================================================================
     
    -SMESH_0D_Algo::SMESH_0D_Algo(int hypId, int studyId, SMESH_Gen* gen)
    -  : SMESH_Algo(hypId, studyId, gen)
    +SMESH_0D_Algo::SMESH_0D_Algo(int hypId, SMESH_Gen* gen)
    +  : SMESH_Algo(hypId, gen)
     {
       _shapeType = (1 << TopAbs_VERTEX);
       _type = ALGO_0D;
     }
    -SMESH_1D_Algo::SMESH_1D_Algo(int hypId, int studyId, SMESH_Gen* gen)
    -  : SMESH_Algo(hypId, studyId, gen)
    +SMESH_1D_Algo::SMESH_1D_Algo(int hypId, SMESH_Gen* gen)
    +  : SMESH_Algo(hypId, gen)
     {
       _shapeType = (1 << TopAbs_EDGE);
       _type = ALGO_1D;
     }
    -SMESH_2D_Algo::SMESH_2D_Algo(int hypId, int studyId, SMESH_Gen* gen)
    -  : SMESH_Algo(hypId, studyId, gen)
    +SMESH_2D_Algo::SMESH_2D_Algo(int hypId, SMESH_Gen* gen)
    +  : SMESH_Algo(hypId, gen)
     {
       _shapeType = (1 << TopAbs_FACE);
       _type = ALGO_2D;
     }
    -SMESH_3D_Algo::SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen)
    -  : SMESH_Algo(hypId, studyId, gen)
    +SMESH_3D_Algo::SMESH_3D_Algo(int hypId, SMESH_Gen* gen)
    +  : SMESH_Algo(hypId, gen)
     {
       _shapeType = (1 << TopAbs_SOLID);
       _type = ALGO_3D;
    diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx
    index ba8c2d356..e35cf6284 100644
    --- a/src/SMESH/SMESH_Algo.hxx
    +++ b/src/SMESH/SMESH_Algo.hxx
    @@ -102,10 +102,9 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
       /*!
        * \brief Creates algorithm
         * \param hypId - algorithm ID
    -    * \param studyId - study ID
         * \param gen - SMESH_Gen
        */
    -  SMESH_Algo(int hypId, int studyId, SMESH_Gen * gen);
    +  SMESH_Algo(int hypId, SMESH_Gen * gen);
     
       /*!
        * \brief Destructor
    @@ -475,19 +474,19 @@ protected:
     class SMESH_EXPORT SMESH_0D_Algo: public SMESH_Algo
     {
     public:
    -  SMESH_0D_Algo(int hypId, int studyId,  SMESH_Gen* gen);
    +  SMESH_0D_Algo(int hypId, SMESH_Gen* gen);
     };
     
     class SMESH_EXPORT SMESH_1D_Algo: public SMESH_Algo
     {
     public:
    -  SMESH_1D_Algo(int hypId, int studyId,  SMESH_Gen* gen);
    +  SMESH_1D_Algo(int hypId, SMESH_Gen* gen);
     };
     
     class SMESH_EXPORT SMESH_2D_Algo: public SMESH_Algo
     {
     public:
    -  SMESH_2D_Algo(int hypId, int studyId, SMESH_Gen* gen);
    +  SMESH_2D_Algo(int hypId, SMESH_Gen* gen);
       /*!
        * \brief Method in which an algorithm generating a structured mesh
        *        fixes positions of in-face nodes after there movement
    @@ -500,7 +499,7 @@ public:
     class SMESH_EXPORT SMESH_3D_Algo: public SMESH_Algo
     {
     public:
    -  SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen);
    +  SMESH_3D_Algo(int hypId, SMESH_Gen* gen);
     };
     
     #endif
    diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx
    index bd5654c89..27881281e 100644
    --- a/src/SMESH/SMESH_Gen.cxx
    +++ b/src/SMESH/SMESH_Gen.cxx
    @@ -65,6 +65,8 @@ using namespace std;
     
     SMESH_Gen::SMESH_Gen()
     {
    +  _studyContext = new StudyContextStruct;
    +  _studyContext->myDocument = new SMESHDS_Document();
       _localId = 0;
       _hypId   = 0;
       _segmentation = _nbSegments = 10;
    @@ -94,19 +96,14 @@ namespace
     
     SMESH_Gen::~SMESH_Gen()
     {
    -  std::map < int, StudyContextStruct * >::iterator i_sc = _mapStudyContext.begin();
    -  for ( ; i_sc != _mapStudyContext.end(); ++i_sc )
    -  {
    -    StudyContextStruct* context = i_sc->second;
    -    std::map < int, SMESH_Hypothesis * >::iterator i_hyp = context->mapHypothesis.begin();
    -    for ( ; i_hyp != context->mapHypothesis.end(); ++i_hyp )
    +    std::map < int, SMESH_Hypothesis * >::iterator i_hyp = _studyContext->mapHypothesis.begin();
    +    for ( ; i_hyp != _studyContext->mapHypothesis.end(); ++i_hyp )
         {
           if ( _Hyp* h = static_cast< _Hyp*>( i_hyp->second ))
             h->NullifyGen();
         }
    -    delete context->myDocument;
    -    delete context;
    -  }
    +  delete _studyContext->myDocument;
    +  delete _studyContext;
     }
     
     //=============================================================================
    @@ -116,21 +113,17 @@ SMESH_Gen::~SMESH_Gen()
      */
     //=============================================================================
     
    -SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
    +SMESH_Mesh* SMESH_Gen::CreateMesh(bool theIsEmbeddedMode)
       throw(SALOME_Exception)
     {
       Unexpect aCatch(SalomeException);
     
    -  // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
    -  StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);
    -
       // create a new SMESH_mesh object
       SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
    -                                     theStudyId,
                                          this,
                                          theIsEmbeddedMode,
    -                                     aStudyContext->myDocument);
    -  aStudyContext->mapMesh[_localId-1] = aMesh;
    +                                     _studyContext->myDocument);
    +  _studyContext->mapMesh[_localId-1] = aMesh;
     
       return aMesh;
     }
    @@ -1149,17 +1142,9 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_subMesh * aSubMesh,
      */
     //=============================================================================
     
    -StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
    +StudyContextStruct *SMESH_Gen::GetStudyContext()
     {
    -  // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
    -
    -  if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
    -  {
    -    _mapStudyContext[studyId] = new StudyContextStruct;
    -    _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
    -  }
    -  StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
    -  return myStudyContext;
    +  return _studyContext;
     }
     
     //================================================================================
    diff --git a/src/SMESH/SMESH_Gen.hxx b/src/SMESH/SMESH_Gen.hxx
    index d01105035..1433a79fa 100644
    --- a/src/SMESH/SMESH_Gen.hxx
    +++ b/src/SMESH/SMESH_Gen.hxx
    @@ -66,7 +66,7 @@ public:
       SMESH_Gen();
       ~SMESH_Gen();
     
    -  SMESH_Mesh* CreateMesh(int theStudyId, bool theIsEmbeddedMode)
    +  SMESH_Mesh* CreateMesh(bool theIsEmbeddedMode)
         throw(SALOME_Exception);
     
       enum ComputeFlags
    @@ -147,7 +147,7 @@ public:
       // if Compute() would fail because of some algo bad state
       // theErrors list contains problems description
     
    -  StudyContextStruct *GetStudyContext(int studyId);
    +  StudyContextStruct *GetStudyContext();
     
       static int GetShapeDim(const TopAbs_ShapeEnum & aShapeType);
       static int GetShapeDim(const TopoDS_Shape &     aShape)
    @@ -165,7 +165,7 @@ public:
     private:
     
       int _localId;                         // unique Id of created objects, within SMESH_Gen entity
    -  std::map < int, StudyContextStruct * >_mapStudyContext;
    +  StudyContextStruct* _studyContext;
     
       // hypotheses managing
       int _hypId;
    diff --git a/src/SMESH/SMESH_Hypothesis.cxx b/src/SMESH/SMESH_Hypothesis.cxx
    index c4107fb38..991eb2e94 100644
    --- a/src/SMESH/SMESH_Hypothesis.cxx
    +++ b/src/SMESH/SMESH_Hypothesis.cxx
    @@ -41,15 +41,13 @@ using namespace std;
     //=============================================================================
     
     SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
    -                                   int studyId,
                                        SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
     {
       _gen            = gen;
    -  _studyId        = studyId;
       _type           = PARAM_ALGO;
       _shapeType      = 0;  // to be set by algo with TopAbs_Enum
       _param_algo_dim = -1; // to be set by algo parameter
    -  StudyContextStruct* myStudyContext = gen->GetStudyContext(_studyId);
    +  StudyContextStruct* myStudyContext = gen->GetStudyContext();
       myStudyContext->mapHypothesis[hypId] = this;
     }
     
    @@ -63,7 +61,7 @@ SMESH_Hypothesis::~SMESH_Hypothesis()
     {
       if ( _gen )
       {
    -    StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
    +    StudyContextStruct* myStudyContext = _gen->GetStudyContext();
         myStudyContext->mapHypothesis[_hypId] = 0;
       }
     }
    @@ -106,22 +104,11 @@ int SMESH_Hypothesis::GetShapeType() const
      */
     //=============================================================================
     
    -int SMESH_Hypothesis::GetStudyId() const
    -{
    -  return _studyId;
    -}
    -
    -//=============================================================================
    -/*!
    - * 
    - */
    -//=============================================================================
    -
     void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
     {
       // for all meshes in study
     
    -  StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
    +  StudyContextStruct* myStudyContext = _gen->GetStudyContext();
       map::iterator itm;
       for (itm = myStudyContext->mapMesh.begin();
            itm != myStudyContext->mapMesh.end();
    @@ -161,7 +148,7 @@ void SMESH_Hypothesis::SetLibName(const char* theLibName)
     
     SMESH_Mesh* SMESH_Hypothesis::GetMeshByPersistentID(int id)
     {
    -  StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
    +  StudyContextStruct* myStudyContext = _gen->GetStudyContext();
       map::iterator itm = myStudyContext->mapMesh.begin();
       for ( ; itm != myStudyContext->mapMesh.end(); itm++)
       {
    diff --git a/src/SMESH/SMESH_Hypothesis.hxx b/src/SMESH/SMESH_Hypothesis.hxx
    index bfcd2f518..60b74bfb4 100644
    --- a/src/SMESH/SMESH_Hypothesis.hxx
    +++ b/src/SMESH/SMESH_Hypothesis.hxx
    @@ -69,10 +69,9 @@ public:
       static bool IsStatusFatal(Hypothesis_Status theStatus)
       { return theStatus >= HYP_UNKNOWN_FATAL; }
     
    -  SMESH_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
    +  SMESH_Hypothesis(int hypId, SMESH_Gen* gen);
       virtual ~SMESH_Hypothesis();
       virtual int GetDim() const;
    -  int         GetStudyId() const;
       SMESH_Gen*  GetGen() const { return (SMESH_Gen*) _gen; }
       virtual int GetShapeType() const;
       virtual const char* GetLibName() const;
    @@ -126,7 +125,6 @@ public:
     
     protected:
       SMESH_Gen* _gen;
    -  int        _studyId;
       int        _shapeType;
       int        _param_algo_dim; // to be set at descendant hypothesis constructor
     
    diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx
    index 893a28aba..9a3393c9a 100644
    --- a/src/SMESH/SMESH_Mesh.cxx
    +++ b/src/SMESH/SMESH_Mesh.cxx
    @@ -106,7 +106,6 @@ class SMESH_Mesh::SubMeshHolder : public SMESHDS_TSubMeshHolder< SMESH_subMesh >
     //=============================================================================
     
     SMESH_Mesh::SMESH_Mesh(int               theLocalId, 
    -                       int               theStudyId, 
                            SMESH_Gen*        theGen,
                            bool              theIsEmbeddedMode,
                            SMESHDS_Document* theDocument):
    @@ -114,7 +113,6 @@ SMESH_Mesh::SMESH_Mesh(int               theLocalId,
     {
       if(MYDEBUG) MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
       _id            = theLocalId;
    -  _studyId       = theStudyId;
       _gen           = theGen;
       _myDocument    = theDocument;
       _myMeshDS      = theDocument->NewMesh(theIsEmbeddedMode,theLocalId);
    @@ -135,7 +133,6 @@ SMESH_Mesh::SMESH_Mesh(int               theLocalId,
     
     SMESH_Mesh::SMESH_Mesh():
       _id(-1),
    -  _studyId(-1),
       _groupId( 0 ),
       _nbSubShapes( 0 ),
       _isShapeToMesh( false ),
    @@ -208,7 +205,7 @@ SMESH_Mesh::~SMESH_Mesh()
       // remove self from studyContext
       if ( _gen )
       {
    -    StudyContextStruct * studyContext = _gen->GetStudyContext( _studyId );
    +    StudyContextStruct * studyContext = _gen->GetStudyContext();
         studyContext->mapMesh.erase( _id );
       }
       if ( _myDocument )
    @@ -248,7 +245,7 @@ SMESH_Mesh* SMESH_Mesh::FindMesh( int meshId ) const
       if ( _id == meshId )
         return (SMESH_Mesh*) this;
     
    -  if ( StudyContextStruct *aStudyContext = _gen->GetStudyContext( _studyId ))
    +  if ( StudyContextStruct *aStudyContext = _gen->GetStudyContext())
       {
         std::map < int, SMESH_Mesh * >::iterator i_m = aStudyContext->mapMesh.find( meshId );
         if ( i_m != aStudyContext->mapMesh.end() )
    @@ -734,7 +731,7 @@ SMESH_Mesh::RemoveHypothesis(const TopoDS_Shape & aSubShape,
       Unexpect aCatch(SalomeException);
       if(MYDEBUG) MESSAGE("SMESH_Mesh::RemoveHypothesis");
     
    -  StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
    +  StudyContextStruct *sc = _gen->GetStudyContext();
       if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
         throw SALOME_Exception(LOCALIZED("hypothesis does not exist"));
     
    @@ -995,7 +992,7 @@ int SMESH_Mesh::GetHypotheses(const SMESH_subMesh *               aSubMesh,
     
     SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const int anHypId) const
     {
    -  StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
    +  StudyContextStruct *sc = _gen->GetStudyContext();
       if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
         return NULL;
     
    diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx
    index a8ec5dfae..158788613 100644
    --- a/src/SMESH/SMESH_Mesh.hxx
    +++ b/src/SMESH/SMESH_Mesh.hxx
    @@ -68,7 +68,6 @@ class SMESH_EXPORT SMESH_Mesh
     {
      public:
       SMESH_Mesh(int               theLocalId,
    -             int               theStudyId,
                  SMESH_Gen*        theGen,
                  bool              theIsEmbeddedMode,
                  SMESHDS_Document* theDocument);
    @@ -359,7 +358,6 @@ private:
       
     protected:
       int                        _id;           // id given by creator (unique within the creator instance)
    -  int                        _studyId;
       int                        _groupId;      // id generator for group objects
       int                        _nbSubShapes;  // initial nb of subshapes in the shape to mesh
       bool                       _isShapeToMesh;// set to true when a shape is given (only once)
    diff --git a/src/SMESHDS/SMESHDS_Document.cxx b/src/SMESHDS/SMESHDS_Document.cxx
    index 4513302d3..f9de0bee1 100644
    --- a/src/SMESHDS/SMESHDS_Document.cxx
    +++ b/src/SMESHDS/SMESHDS_Document.cxx
    @@ -35,7 +35,7 @@ using namespace std;
     //function : Create
     //purpose  : 
     //=======================================================================
    -SMESHDS_Document::SMESHDS_Document(int UserID):myUserID(UserID)
    +SMESHDS_Document::SMESHDS_Document()
     {
     }
     
    diff --git a/src/SMESHDS/SMESHDS_Document.hxx b/src/SMESHDS/SMESHDS_Document.hxx
    index 73fdc3b9f..1cb0c9a9b 100644
    --- a/src/SMESHDS/SMESHDS_Document.hxx
    +++ b/src/SMESHDS/SMESHDS_Document.hxx
    @@ -37,29 +37,28 @@
     class SMESHDS_EXPORT SMESHDS_Document
     {
       public:
    -        SMESHDS_Document(int UserID);
    -        ~SMESHDS_Document();
    -        SMESHDS_Mesh *       NewMesh(bool theIsEmbeddedMode, int MeshID);
    -        void                 RemoveMesh(int MeshID);
    -        SMESHDS_Mesh *       GetMesh(int MeshID);
    -        void                 AddHypothesis(SMESHDS_Hypothesis * H);
    -        void                 RemoveHypothesis(int HypID);
    -        SMESHDS_Hypothesis * GetHypothesis(int HypID);
    -        int                  NbMeshes();
    -        int                  NbHypothesis();
    -        void                 InitMeshesIterator();
    -        SMESHDS_Mesh *       NextMesh();
    -        bool                 MoreMesh();        
    -        void                 InitHypothesisIterator();
    -        SMESHDS_Hypothesis * NextHypothesis();
    -        bool                 MoreHypothesis();  
    +    SMESHDS_Document();
    +    ~SMESHDS_Document();
    +    SMESHDS_Mesh *       NewMesh(bool theIsEmbeddedMode, int MeshID);
    +    void                 RemoveMesh(int MeshID);
    +    SMESHDS_Mesh *       GetMesh(int MeshID);
    +    void                 AddHypothesis(SMESHDS_Hypothesis * H);
    +    void                 RemoveHypothesis(int HypID);
    +    SMESHDS_Hypothesis * GetHypothesis(int HypID);
    +    int                  NbMeshes();
    +    int                  NbHypothesis();
    +    void                 InitMeshesIterator();
    +    SMESHDS_Mesh *       NextMesh();
    +    bool                 MoreMesh();
    +    void                 InitHypothesisIterator();
    +    SMESHDS_Hypothesis * NextHypothesis();
    +    bool                 MoreHypothesis();
     
       private:
    -        int                                         myUserID;
    -        std::map                 myMeshes;
    -        std::map           myHypothesis;
    -        std::map::iterator       myMeshesIt;
    -        std::map::iterator myHypothesisIt;
    +    std::map                 myMeshes;
    +    std::map           myHypothesis;
    +    std::map::iterator       myMeshesIt;
    +    std::map::iterator myHypothesisIt;
     };
     
     #endif
    diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx
    index 1145efb17..3f2b88771 100644
    --- a/src/SMESHGUI/SMESHGUI.cxx
    +++ b/src/SMESHGUI/SMESHGUI.cxx
    @@ -194,7 +194,7 @@ namespace
     
       void ExportMeshToFile(int theCommandID);
     
    -  void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap);
    +  void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap);
     
       void SetDisplayEntity(int theCommandID);
     
    @@ -276,7 +276,7 @@ namespace
         if ( filenames.count() > 0 )
         {
           SUIT_OverrideCursor wc;
    -      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +      _PTR(Study) aStudy = SMESH::getStudy();
     
           QStringList errors;
           QStringList anEntryList;
    @@ -1336,7 +1336,7 @@ namespace
           if ( selected.Extent() )
           {
             Handle(SALOME_InteractiveObject) anIObject = selected.First();
    -        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +        _PTR(Study) aStudy = SMESH::getStudy();
             _PTR(SObject) aSObj = aStudy->FindObjectID(anIObject->getEntry());
             if (aSObj) {
               if ( aStudy->GetUseCaseBuilder()->SortChildren( aSObj, true/*AscendingOrder*/ ) ) {
    @@ -1347,7 +1347,7 @@ namespace
         }
       }
     
    -  void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap)
    +  void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap)
       {
         SALOME_ListIO selected;
         SalomeApp_Application* app =
    @@ -1369,8 +1369,6 @@ namespace
           return;
         }
     
    -    _PTR(Study) aStudy = appStudy->studyDS();
    -
         aSel->selectedObjects( selected );
     
         if ( selected.Extent() >= 1 )
    @@ -1469,7 +1467,7 @@ namespace
                 break;
             }
     
    -        SMESHGUI_PropertiesDlg dlg( theMarkerMap[ aStudy->StudyId() ], SMESHGUI::desktop() );
    +        SMESHGUI_PropertiesDlg dlg( theMarkerMap, SMESHGUI::desktop() );
             // nodes: color, marker
             dlg.setNodeColor( nodeColor );
             if( markerType != VTK::MT_USER )
    @@ -1525,8 +1523,8 @@ namespace
               orientation3d    = dlg.orientation3d();
               shrinkCoef       = dlg.shrinkCoef() / 100.;
     
    -          // store point markers map that might be changed by the user
    -          theMarkerMap[ aStudy->StudyId() ] = dlg.customMarkers();
    +          // store point markers that might be changed by the user
    +          theMarkerMap = dlg.customMarkers();
     
               // set properties from dialog box to the presentations
               SALOME_ListIteratorOfListIO It( selected );
    @@ -1542,9 +1540,8 @@ namespace
                   anActor->SetMarkerStd( markerType, markerScale );
                 }
                 else {
    -              const VTK::MarkerMap& markerMap = theMarkerMap[ aStudy->StudyId() ];
    -              VTK::MarkerMap::const_iterator iter = markerMap.find( markerId );
    -              if ( iter != markerMap.end() )
    +              VTK::MarkerMap::const_iterator iter = theMarkerMap.find( markerId );
    +              if ( iter != theMarkerMap.end() )
                     anActor->SetMarkerTexture( markerId, iter->second.second );
                 }
                 // volumes: normal color, reversed color (delta)
    @@ -1682,7 +1679,7 @@ namespace
       void Control( int theCommandID )
       {
         SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ));
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +    _PTR(Study) aStudy = SMESH::getStudy();
     
         SALOME_ListIO selected;
         if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
    @@ -1701,7 +1698,7 @@ namespace
                 if ( !anIDSrc->_is_nil() ) {
                   SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry());
                   if (( !anActor && selected.Extent() == 1 ) &&
    -                  ( anActor = SMESH::CreateActor( aStudy, anIO->getEntry() )))
    +                  ( anActor = SMESH::CreateActor( anIO->getEntry() )))
                   {
                     anActor->SetControlMode( aControl );
                     SMESH::DisplayActor( SMESH::GetCurrentVtkView(), anActor );
    @@ -1758,7 +1755,7 @@ namespace
     
       QString CheckTypeObject(const Handle(SALOME_InteractiveObject) & theIO)
       {
    -    _PTR(Study)  aStudy = SMESH::GetActiveStudyDocument();
    +    _PTR(Study)  aStudy = SMESH::getStudy();
         _PTR(SObject) aSObj = aStudy->FindObjectID(theIO->getEntry());
         if (aSObj) {
           _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
    @@ -1822,7 +1819,7 @@ void SMESHGUI::OnEditDelete()
       LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
       SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
     
    -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +  _PTR(Study) aStudy = SMESH::getStudy();
       _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
       _PTR(GenericAttribute) anAttr;
       _PTR(AttributeIOR) anIOR;
    @@ -2210,17 +2207,6 @@ SMESHGUI* SMESHGUI::GetSMESHGUI()
         smeshMod = dynamic_cast( module );
       }
     
    -  if ( smeshMod && smeshMod->application() && smeshMod->application()->activeStudy() )
    -  {
    -    SalomeApp_Study* study = dynamic_cast( smeshMod->application()->activeStudy() );
    -    if ( study )
    -    {
    -      _PTR(Study) aStudy = study->studyDS();
    -      if ( aStudy )
    -        GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
    -    }
    -  }
    -
       return smeshMod;
     }
     
    @@ -2393,36 +2379,27 @@ bool SMESHGUI::DefineDlgPosition(QWidget * aDlg, int &x, int &y)
       return true;
     }
     
    -//=============================================================================
     /*!
    - *
    - */
    -//=============================================================================
    -static int isStudyLocked(_PTR(Study) theStudy){
    -  return theStudy->GetProperties()->IsLocked();
    -}
    -
    -static bool checkLock(_PTR(Study) theStudy) {
    -  if (isStudyLocked(theStudy)) {
    -    SUIT_MessageBox::warning( SMESHGUI::desktop(),
    -                              QObject::tr("WRN_WARNING"),
    -                              QObject::tr("WRN_STUDY_LOCKED") );
    + * \brief Verifies whether study of operation is locked
    +  * \param theMess - specifies whether message box must be shown if study is locked
    +  * \return State of study.
    +*
    +* Verifies whether study of operation is locked. If second parameter is TRUE and study
    +* is locked when corresponding message box appears
    +*/
    +bool SMESHGUI::isStudyLocked( bool theMessage )
    +{
    +  if ( SMESH::getStudy()->GetProperties()->IsLocked() )
    +  {
    +    if ( theMessage )
    +      SUIT_MessageBox::warning( SMESHGUI::desktop(),
    +                                QObject::tr( "WRN_WARNING" ),
    +                                QObject::tr( "WRN_STUDY_LOCKED" ) );
         return true;
       }
       return false;
     }
     
    -//=======================================================================
    -//function : CheckActiveStudyLocked
    -//purpose  :
    -//=======================================================================
    -
    -bool SMESHGUI::isActiveStudyLocked()
    -{
    -  _PTR(Study) aStudy = activeStudy()->studyDS();
    -  return checkLock( aStudy );
    -}
    -
     //=============================================================================
     /*!
      *
    @@ -2434,15 +2411,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       if( !anApp )
         return false;
     
    -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
       SUIT_ResourceMgr* mgr = resourceMgr();
       if( !mgr )
         return false;
     
    -  if (CORBA::is_nil(GetSMESHGen()->GetCurrentStudy())) {
    -    GetSMESHGen()->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
    -  }
    -
       SUIT_ViewWindow* view = application()->desktop()->activeWindow();
       SVTK_ViewWindow* vtkwnd = dynamic_cast( view );
     
    @@ -2450,7 +2422,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
       switch (theCommandID) {
       case SMESHOp::OpDelete:
    -    if(checkLock(aStudy)) break;
    +    if(isStudyLocked()) break;
         OnEditDelete();
         break;
       case SMESHOp::OpImportDAT:
    @@ -2468,7 +2440,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       case SMESHOp::OpPopupImportSAUV:
       case SMESHOp::OpPopupImportGMF:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           ::ImportMeshesFromFile(GetSMESHGen(),theCommandID);
           break;
         }
    @@ -2630,7 +2602,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
       case SMESHOp::OpUpdate:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           SUIT_OverrideCursor wc;
           try {
     #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
    @@ -2697,7 +2669,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             }
     
             // PAL13338 + PAL15161 -->
    -        if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !checkLock(aStudy)) {
    +        if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !isStudyLocked()) {
               SMESH::UpdateView();
               SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
             }
    @@ -2719,7 +2691,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
       case SMESHOp::OpNode:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
     
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
    @@ -2746,14 +2718,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         break;
       case SMESHOp::OpCopyMesh:
         {
    -      if (checkLock(aStudy)) break;
    +      if (isStudyLocked()) break;
           EmitSignalDeactivateDialog();
           ( new SMESHGUI_CopyMeshDlg( this ) )->show();
         }
         break;
       case SMESHOp::OpBuildCompoundMesh:
         {
    -      if (checkLock(aStudy)) break;
    +      if (isStudyLocked()) break;
           EmitSignalDeactivateDialog();
           ( new SMESHGUI_BuildCompoundDlg( this ) )->show();
         }
    @@ -2768,7 +2740,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             break;
           }
     
    -      if ( checkLock( aStudy ) )
    +      if ( isStudyLocked() )
             break;
     
           /*Standard_Boolean aRes;
    @@ -2798,7 +2770,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             break;
           }
     
    -      if ( checkLock( aStudy ) )
    +      if ( isStudyLocked() )
             break;
     
           EmitSignalDeactivateDialog();
    @@ -2817,7 +2789,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpSmoothing:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_SmoothingDlg( this ) )->show();
    @@ -2829,7 +2801,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpExtrusion:
         {
    -      if (checkLock(aStudy)) break;
    +      if (isStudyLocked()) break;
           if (vtkwnd) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_ExtrusionDlg ( this ) )->show();
    @@ -2840,7 +2812,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpExtrusionAlongAPath:
         {
    -      if (checkLock(aStudy)) break;
    +      if (isStudyLocked()) break;
           if (vtkwnd) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
    @@ -2851,7 +2823,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpRevolution:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_RevolutionDlg( this ) )->show();
    @@ -2863,7 +2835,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpPatternMapping:
         {
    -      if ( checkLock( aStudy ) )
    +      if ( isStudyLocked() )
             break;
           if ( vtkwnd )
           {
    @@ -2892,7 +2864,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             break;
           }
     
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           EmitSignalDeactivateDialog();
           SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
     
    @@ -2919,7 +2891,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             break;
           }
     
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           EmitSignalDeactivateDialog();
     
           LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
    @@ -2932,7 +2904,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             // check if submesh is selected
             Handle(SALOME_InteractiveObject) IObject = selected.First();
             if (IObject->hasEntry()) {
    -          _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
    +          _PTR(SObject) aSObj = SMESH::getStudy()->FindObjectID(IObject->getEntry());
               if( aSObj ) {
                 SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
                 if (!aSubMesh->_is_nil()) {
    @@ -2996,7 +2968,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             break;
           }
     
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           EmitSignalDeactivateDialog();
     
           LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
    @@ -3026,7 +2998,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
       case SMESHOp::OpAddElemGroupPopup:     // Add elements to group
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if (myState == 800) {
             SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
             if (aDlg) aDlg->onAdd();
    @@ -3036,7 +3008,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
       case SMESHOp::OpRemoveElemGroupPopup:  // Remove elements from group
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if (myState == 800) {
             SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
             if (aDlg) aDlg->onRemove();
    @@ -3052,7 +3024,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             break;
           }
     
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           EmitSignalDeactivateDialog();
     
           LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
    @@ -3092,7 +3064,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             break;
           }
     
    -      if ( checkLock( aStudy ) )
    +      if ( isStudyLocked() )
             break;
     
           EmitSignalDeactivateDialog();
    @@ -3112,7 +3084,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
         case SMESHOp::OpGroupUnderlyingElem: // Create groups of entities from existing groups of superior dimensions
         {
    -      if ( checkLock( aStudy ) )
    +      if ( isStudyLocked() )
             break;
     
           EmitSignalDeactivateDialog();
    @@ -3130,7 +3102,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             break;
           }
     
    -      if ( checkLock( aStudy ) )
    +      if ( isStudyLocked() )
             break;
     
           EmitSignalDeactivateDialog();
    @@ -3172,7 +3144,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
       case SMESHOp::OpEditHypothesis:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
     
           LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
           SALOME_ListIO selected;
    @@ -3217,7 +3189,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpUnassign:                      // REMOVE HYPOTHESIS / ALGORITHMS
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           SUIT_OverrideCursor wc;
     
           LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
    @@ -3248,7 +3220,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       case SMESHOp::OpPyramid:
       case SMESHOp::OpHexagonalPrism:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
             SMDSAbs_EntityType type = SMDSEntity_Edge;
    @@ -3274,7 +3246,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpPolyhedron:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
    @@ -3296,7 +3268,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       case SMESHOp::OpQuadraticHexahedron:
       case SMESHOp::OpTriQuadraticHexahedron:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
             SMDSAbs_EntityType type = SMDSEntity_Last;
    @@ -3326,7 +3298,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpRemoveNodes:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_RemoveNodesDlg( this ) )->show();
    @@ -3339,7 +3311,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpRemoveElements:                                    // REMOVES ELEMENTS
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_RemoveElementsDlg( this ) )->show();
    @@ -3353,7 +3325,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpClearMesh: {
     
    -    if(checkLock(aStudy)) break;
    +    if(isStudyLocked()) break;
     
         SALOME_ListIO selected;
         if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
    @@ -3374,7 +3346,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
             SMESH::ModifiedMesh( aMeshSObj, false, true);
             // hide groups and submeshes
             _PTR(ChildIterator) anIter =
    -          SMESH::GetActiveStudyDocument()->NewChildIterator( aMeshSObj );
    +          SMESH::getStudy()->NewChildIterator( aMeshSObj );
             for ( anIter->InitEx(true); anIter->More(); anIter->Next() )
             {
               _PTR(SObject) so = anIter->Value();
    @@ -3393,7 +3365,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       }
       case SMESHOp::OpRemoveOrphanNodes:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           SALOME_ListIO selected;
           if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
             aSel->selectedObjects( selected );
    @@ -3432,7 +3404,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpRenumberingNodes:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
    @@ -3446,7 +3418,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpRenumberingElements:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
    @@ -3460,7 +3432,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpTranslation:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_TranslationDlg( this ) )->show();
    @@ -3473,7 +3445,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpRotation:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_RotationDlg( this ) )->show();
    @@ -3486,7 +3458,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpSymmetry:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if(vtkwnd) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_SymmetryDlg( this ) )->show();
    @@ -3499,7 +3471,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpScale:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_ScaleDlg( this ) )->show();
    @@ -3513,7 +3485,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
       case SMESHOp::OpSewing:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if(vtkwnd) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_SewingDlg( this ) )->show();
    @@ -3526,7 +3498,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpMergeNodes:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if(vtkwnd) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_MergeDlg( this, 0 ) )->show();
    @@ -3539,7 +3511,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       case SMESHOp::OpMergeElements:
         {
    -      if (checkLock(aStudy)) break;
    +      if (isStudyLocked()) break;
           if (vtkwnd) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_MergeDlg( this, 1 ) )->show();
    @@ -3556,7 +3528,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     
       case SMESHOp::OpDuplicateNodes:
         {
    -      if(checkLock(aStudy)) break;
    +      if(isStudyLocked()) break;
           if ( vtkwnd ) {
             EmitSignalDeactivateDialog();
             ( new SMESHGUI_DuplicateNodesDlg( this ) )->show();
    @@ -4849,11 +4821,7 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
       action(SMESHOp::OpDelete)->setEnabled(true); // Delete: Key_Delete
     
       //  0020210. Make SMESH_Gen update meshes at switching GEOM->SMESH
    -  GetSMESHGen()->SetCurrentStudy(SALOMEDS::Study::_nil());
    -  if ( SalomeApp_Study* s = dynamic_cast( study )) {
    -    if ( _PTR(Study) aStudy = s->studyDS() )
    -      GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
    -  }
    +  GetSMESHGen()->UpdateStudy();
     
       // get all view currently opened in the study and connect their signals  to
       // the corresponding slots of the class.
    @@ -4886,7 +4854,7 @@ void SMESHGUI::studyClosed( SUIT_Study* s )
     {
       if( !s )
         return;
    -  SMESH::RemoveVisuData( s->id() );
    +  SMESH::RemoveVisuData();
       SalomeApp_Module::studyClosed( s );
     }
     
    @@ -4902,16 +4870,11 @@ void SMESHGUI::OnGUIEvent()
     
     SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
     {
    -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
       if ( CORBA::is_nil( myComponentSMESH ) )
    -    {
    -      SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
    -      if ( aStudy )
    -        aGUI.myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
    -      return aGUI.myComponentSMESH;
    -    }
    -  if ( aStudy )
    -    myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
    +  {
    +    SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
    +    return aGUI.myComponentSMESH;
    +  }
       return myComponentSMESH;
     }
     
    @@ -5621,8 +5584,7 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const
     
     void SMESHGUI::switchToOperation(int id)
     {
    -  if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() )
    -    activeStudy()->abortAllOperations();
    +  activeStudy()->abortAllOperations();
       startOperation( id );
     }
     
    @@ -5715,12 +5677,11 @@ void SMESHGUI::storeVisualParameters (int savePoint)
                                                                  savePoint);
       _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
     
    -  // store map of custom markers
    -  const VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
    -  if( !aMarkerMap.empty() )
    +  // store custom markers
    +  if( !myMarkerMap.empty() )
       {
    -    VTK::MarkerMap::const_iterator anIter = aMarkerMap.begin();
    -    for( ; anIter != aMarkerMap.end(); anIter++ )
    +    VTK::MarkerMap::const_iterator anIter = myMarkerMap.begin();
    +    for( ; anIter != myMarkerMap.end(); anIter++ )
         {
           int anId = anIter->first;
           VTK::MarkerData aMarkerData = anIter->second;
    @@ -6068,8 +6029,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
                                                                  savePoint);
       _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
     
    -  // restore map of custom markers and map of clipping planes
    -  VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
    +  // restore custom markers and map of clipping planes
       TPlaneDataMap aPlaneDataMap;
     
       std::vector properties = ip->getProperties();
    @@ -6126,7 +6086,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
               aMarkerTexture.push_back( aChar.digitValue() );
           }
     
    -      aMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
    +      myMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
         }
         else if( aPropertyType == "ClippingPlane" )
         {
    @@ -6644,8 +6604,8 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
                         aSmeshActor->SetMarkerStd( (VTK::MarkerType)aParam1, (VTK::MarkerScale)aParam2 );
                       }
                       else if( data[0] == "custom" ) {
    -                    VTK::MarkerMap::const_iterator markerIt = aMarkerMap.find( aParam1 );
    -                    if( markerIt != aMarkerMap.end() ) {
    +                    VTK::MarkerMap::const_iterator markerIt = myMarkerMap.find( aParam1 );
    +                    if( markerIt != myMarkerMap.end() ) {
                           VTK::MarkerData aMarkerData = markerIt->second;
                           aSmeshActor->SetMarkerTexture( aParam1, aMarkerData.second );
                         }
    @@ -7049,7 +7009,7 @@ bool SMESHGUI::renameAllowed( const QString& entry) const {
         return false;
     
       // check type to prevent renaming of inappropriate objects
    -  int aType = SMESHGUI_Selection::type(qPrintable(entry), SMESH::GetActiveStudyDocument());
    +  int aType = SMESHGUI_Selection::type(qPrintable(entry));
       if (aType == SMESH::MESH || aType == SMESH::GROUP ||
           aType == SMESH::SUBMESH || aType == SMESH::SUBMESH_COMPOUND ||
           aType == SMESH::SUBMESH_SOLID || aType == SMESH::SUBMESH_FACE ||
    @@ -7096,7 +7056,7 @@ bool SMESHGUI::renameObject( const QString& entry, const QString& name) {
         if ( obj->FindAttribute(anAttr, "AttributeName") ) {
           aName = anAttr;
           // check type to prevent renaming of inappropriate objects
    -      int aType = SMESHGUI_Selection::type( qPrintable(entry), SMESH::GetActiveStudyDocument() );
    +      int aType = SMESHGUI_Selection::type( qPrintable(entry));
           if (aType == SMESH::MESH || aType == SMESH::GROUP ||
               aType == SMESH::SUBMESH || aType == SMESH::SUBMESH_COMPOUND ||
               aType == SMESH::SUBMESH_SOLID || aType == SMESH::SUBMESH_FACE ||
    diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h
    index 92a51bf56..44b7671bb 100644
    --- a/src/SMESHGUI/SMESHGUI.h
    +++ b/src/SMESHGUI/SMESHGUI.h
    @@ -63,8 +63,6 @@ class LightApp_SelectionMgr;
     class SMESH_Actor;
     class SMESHGUI_FilterLibraryDlg;
     
    -typedef std::map SMESHGUI_StudyId2MarkerMap;
    -
     namespace SMESH
     {
       class OrientedPlane;
    @@ -96,14 +94,14 @@ public :
       static SUIT_ResourceMgr*        resourceMgr();
       static SUIT_Desktop*            desktop();
       static SalomeApp_Study*         activeStudy();
    -  
    -  bool                            isActiveStudyLocked();
     
       static bool                     automaticUpdate(unsigned int requestedSize = 0, bool* limitExceeded = 0);
       static bool                     automaticUpdate( SMESH::SMESH_IDSource_ptr, int*, bool*, int*, long* );
     
       static void                     Modified( bool = true );
     
    +  static bool                     isStudyLocked( bool = true );
    +
       virtual LightApp_Displayer*     displayer();
       virtual QString                 engineIOR() const;
       virtual void                    initialize( CAM_Application* );
    @@ -225,7 +223,7 @@ private :
     
       SMESHGUI_FilterLibraryDlg*      myFilterLibraryDlg;
     
    -  SMESHGUI_StudyId2MarkerMap      myMarkerMap;
    +  VTK::MarkerMap                  myMarkerMap;
       SMESHGUI_ClippingPlaneInfoMap   myClippingPlaneInfoMap;
     
       vtkSmartPointer myEventCallbackCommand;
    diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
    index 30a8fc92d..a015b4181 100644
    --- a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
    @@ -310,8 +310,7 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::selectionDone()
         _PTR(SObject) group0DRoot;
         if ( meshSO && meshSO->FindSubObject( SMESH::Tag_0DElementsGroups, group0DRoot ))
         {
    -      _PTR(Study)              aStudy = SMESH::GetActiveStudyDocument();
    -      _PTR(ChildIterator) group0DIter = aStudy->NewChildIterator( group0DRoot );
    +      _PTR(ChildIterator) group0DIter = SMESH::getStudy()->NewChildIterator( group0DRoot );
           for ( ; group0DIter->More(); group0DIter->Next() )
           {
             _PTR(SObject) groupSO = group0DIter->Value();
    diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
    index 25bbd46e7..aea995c88 100644
    --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
    @@ -549,7 +549,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
       if( !isValid() )
         return;
     
    -  if (myNbOkNodes && !mySMESHGUI->isActiveStudyLocked()) {
    +  if (myNbOkNodes && !SMESHGUI::isStudyLocked()) {
         myBusy = true;
         QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
         SMESH::long_array_var anArrayOfIndices = new SMESH::long_array;
    diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
    index c24dbc4b3..d23b06628 100644
    --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
    @@ -686,7 +686,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
       if( !isValid() )
         return false;
     
    -  if ( mySMESHGUI->isActiveStudyLocked() || myBusy || !IsValid() )
    +  if ( SMESHGUI::isStudyLocked() || myBusy || !IsValid() )
         return false;
     
       BusyLocker lock( myBusy );
    diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
    index aac578ba2..0cd63352b 100644
    --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
    @@ -250,10 +250,7 @@ QString SMESHGUI_BuildCompoundDlg::GetDefaultName(const QString& theOperation)
       QString aName = "";
     
       // collect all object names of SMESH component
    -  SalomeApp_Study* appStudy =
    -    dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() );
    -  if ( !appStudy ) return aName;
    -  _PTR(Study) aStudy = appStudy->studyDS();
    +  _PTR(Study) aStudy = SMESH::getStudy();
     
       std::set aSet;
       _PTR(SComponent) aMeshCompo (aStudy->FindComponent("SMESH"));
    @@ -283,7 +280,7 @@ QString SMESHGUI_BuildCompoundDlg::GetDefaultName(const QString& theOperation)
     //=================================================================================
     bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if (!isValid())
    @@ -335,7 +332,7 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
           SMESH::UpdateView();
     
           _PTR(SObject) aSO = SMESH::FindSObject(aMesh.in());
    -      if ( SMESH_Actor* anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str()) ) {
    +      if ( SMESH_Actor* anActor = SMESH::CreateActor( aSO->GetID().c_str()) ) {
             SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
             SMESH::UpdateView();
           }
    diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
    index d7d455b6d..55a87509d 100644
    --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
    @@ -1068,11 +1068,7 @@ void SMESHGUI_ClippingDlg::updateActorList()
     {
       ActorList->clear();
     
    -  SalomeApp_Study* anAppStudy = SMESHGUI::activeStudy();
    -  if( !anAppStudy )
    -    return;
    -
    -  _PTR(Study) aStudy = anAppStudy->studyDS();
    +  _PTR(Study) aStudy = SMESH::getStudy();
       if( !aStudy )
         return;
     
    diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
    index 5a32503a1..fa746f19a 100644
    --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
    @@ -379,9 +379,7 @@ namespace SMESH
         _PTR(SObject) so = SMESH::FindSObject(aMainShape);
         if ( subShapeID == 1 || !so )
           return so;
    -    _PTR(ChildIterator) it;
    -    if (_PTR(Study) study = SMESH::GetActiveStudyDocument())
    -      it =  study->NewChildIterator(so);
    +    _PTR(ChildIterator) it = SMESH::getStudy()->NewChildIterator(so);
         _PTR(SObject) subSO;
         if ( it ) {
           for ( it->InitEx(true); !subSO && it->More(); it->Next() ) {
    @@ -927,7 +925,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
     
         // NPAL16631: if ( !memoryLack )
         {
    -      _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID(myIObject->getEntry());
    +      _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID(myIObject->getEntry());
           SMESH::ModifiedMesh( sobj,
                                !computeFailed && aHypErrors.isEmpty(),
                                myMesh->NbNodes() == 0);
    @@ -998,8 +996,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
                   {
                     toDisplay = true;
                     SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
    -                if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(),
    -                                                              (*anIter).second->GetID().c_str(),
    +                if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetID().c_str(),
                                                                   /*clearLog =*/ true );
                     if ( anActor ) // actor is not created for an empty mesh
                     {
    @@ -1267,7 +1264,6 @@ void SMESHGUI_BaseComputeOp::stopOperation()
     void SMESHGUI_BaseComputeOp::onPublishShape()
     {
       GEOM::GEOM_Gen_var      geomGen = SMESH::GetGEOMGen();
    -  SALOMEDS::Study_var       study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
       GEOM::GEOM_Object_var meshShape = myMesh->GetShapeToMesh();
     
       QStringList entryList;
    @@ -1283,7 +1279,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
           if ( !SMESH::getSubShapeSO( 1, myMainShape )) // the main shape not published
           {
             QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" ));
    -        SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, myMainShape,
    +        SALOMEDS::SObject_wrap so = geomGen->AddInStudy( myMainShape,
                                                              name.toLatin1().data(),
                                                              GEOM::GEOM_Object::_nil());
             // look for myMainShape in the table
    @@ -1302,7 +1298,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
             if ( curSub == 1 ) continue;
           }
           QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" ));
    -      SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, shape,
    +      SALOMEDS::SObject_wrap so = geomGen->AddInStudy( shape,
                                                            name.toLatin1().data(), myMainShape);
           if ( !so->_is_nil() ) {
             CORBA::String_var name  = so->GetName();
    @@ -1743,7 +1739,7 @@ void SMESHGUI_PrecomputeOp::initDialog()
       QList modes;
     
       QMap modeMap;
    -  _PTR(SObject)  pMesh = studyDS()->FindObjectID( myIObject->getEntry() );
    +  _PTR(SObject)  pMesh = SMESH::getStudy()->FindObjectID( myIObject->getEntry() );
       getAssignedAlgos( pMesh, modeMap );
       if ( modeMap.contains( SMESH::DIM_3D ) )
       {
    @@ -1786,8 +1782,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject)  theMesh,
       int aPart = SMESH::Tag_RefOnAppliedAlgorithms;
       if ( theMesh->FindSubObject( aPart, aHypFolder ))
       {
    -    _PTR(ChildIterator) anIter =
    -      SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder );
    +    _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypFolder );
         for ( ; anIter->More(); anIter->Next() )
         {
           _PTR(SObject) anObj = anIter->Value();
    @@ -1830,8 +1825,7 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject)  theMesh,
         if ( !theMesh->FindSubObject( aPart, aHypFolder ))
           continue;
     
    -    _PTR(ChildIterator) anIter =
    -      SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder );
    +    _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypFolder );
         for ( anIter->InitEx(true); anIter->More(); anIter->Next() )
         {
           _PTR(SObject) anObj = anIter->Value();
    diff --git a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx
    index 3afa881c1..b412f118d 100644
    --- a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx
    +++ b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx
    @@ -129,7 +129,7 @@ void SMESHGUI_ConvToQuadOp::selectionDone()
       try
       {
         QString anObjEntry = myDlg->selectedObject( 0 );
    -    _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
    +    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
         if ( !pObj ) return;
     
         SMESH::SMESH_IDSource_var idSource = 
    @@ -204,7 +204,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
       QString aMess;
     
       QString anObjEntry = myDlg->selectedObject( 0 );
    -  _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
    +  _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
       if ( !pObj )
       {
         dlg()->show();
    @@ -382,7 +382,7 @@ SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSourc
     void SMESHGUI_ConvToQuadOp::ConnectRadioButtons( int id )
     {
       QString anObjEntry = myDlg->selectedObject( 0 );
    -  _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
    +  _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
       if ( !pObj ) return;
     
       SMESH::SMESH_IDSource_var idSource = 
    diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx
    index 0fc5aef49..b6609fcff 100644
    --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx
    @@ -303,7 +303,7 @@ void SMESHGUI_CopyMeshDlg::Init (bool ResetControls)
     
     bool SMESHGUI_CopyMeshDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if( !isValid() )
    diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
    index e938f0667..38f64d2ad 100644
    --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
    @@ -448,7 +448,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply()
       if( !isValid() )
         return;
     
    -  if ( myNbOkElements>0 && !mySMESHGUI->isActiveStudyLocked())
    +  if ( myNbOkElements>0 && !SMESHGUI::isStudyLocked())
         {
           if(checkEditLine(false) == -1) {return;}
           busy = true;
    diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
    index 7711022c3..6f589a9a0 100644
    --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx
    @@ -194,7 +194,7 @@ bool SMESHGUI_DeleteGroupDlg::isValid()
         return false;
       }
     
    -  return !mySMESHGUI->isActiveStudyLocked();
    +  return !SMESHGUI::isStudyLocked();
     }
     
     //=================================================================================
    diff --git a/src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx b/src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx
    index 14088fe1a..fd673c22a 100644
    --- a/src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx
    @@ -233,8 +233,7 @@ void SMESHGUI_DisplayEntitiesDlg::onOk()
       const char* entry = myIObject->getEntry();
       
       if ( !myActor ) {
    -    myActor = SMESH::CreateActor(SMESH::GetActiveStudyDocument(), 
    -                                 entry, true);
    +    myActor = SMESH::CreateActor(entry, true);
       }
     
       if( myEntityMode != myActor->GetEntityMode() ) {
    diff --git a/src/SMESHGUI/SMESHGUI_Displayer.cxx b/src/SMESHGUI/SMESHGUI_Displayer.cxx
    index 6fa1ee65c..633d9196a 100644
    --- a/src/SMESHGUI/SMESHGUI_Displayer.cxx
    +++ b/src/SMESHGUI/SMESHGUI_Displayer.cxx
    @@ -68,7 +68,7 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_
           SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
           SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() );
           if( !anActor )
    -        anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
    +        anActor = SMESH::CreateActor( entry.toLatin1().data(), true );
           if( anActor )
           {
             SMESH::DisplayActor( wnd, anActor );
    @@ -94,12 +94,7 @@ bool SMESHGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vi
       if(viewer_type != SVTK_Viewer::Type())
         return res;
       
    -  SalomeApp_Study* study = dynamic_cast( myApp->activeStudy() );
    -  if( !study )
    -    return res;
    -  
    -  
    -  _PTR(SObject) obj = study->studyDS()->FindObjectID( (const char*)entry.toLatin1() );
    +  _PTR(SObject) obj = SMESH::getStudy()->FindObjectID( (const char*)entry.toLatin1() );
       CORBA::Object_var anObj = SMESH::SObjectToObject( obj );
       
         /*
    diff --git a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx
    index 297a85d47..0eb48be83 100644
    --- a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx
    @@ -395,7 +395,7 @@ void SMESHGUI_DuplicateNodesDlg::onConstructorsClicked (int constructorId)
     */
     bool SMESHGUI_DuplicateNodesDlg::onApply()
     {
    -  if ( mySMESHGUI->isActiveStudyLocked() || !isValid() )
    +  if ( SMESHGUI::isStudyLocked() || !isValid() )
         return false;
     
       BusyLocker lock( myBusy );
    diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
    index 9b6ce1843..417d1f803 100644
    --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
    @@ -394,7 +394,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::CheckIsEnable()
     //=================================================================================
     bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if ( !SelectorWdg->IsAnythingSelected() || myPath->_is_nil() )
    diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
    index 205544cfa..7a37a1715 100644
    --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
    @@ -1092,7 +1092,7 @@ void SMESHGUI_ExtrusionDlg::ClickOnRadio()
     
     bool SMESHGUI_ExtrusionDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if (!isValid())
    diff --git a/src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx b/src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx
    index 8b060f647..7ab25ef53 100644
    --- a/src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_FieldSelectorWdg.cxx
    @@ -92,9 +92,8 @@ GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
       myFields = & fields;
       myTree->clear();
       
    -  _PTR(Study) study = SMESH::GetActiveStudyDocument();
       GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
    -  GEOM::GEOM_IFieldOperations_wrap fieldOp = geomGen->GetIFieldOperations( study->StudyId() );
    +  GEOM::GEOM_IFieldOperations_wrap fieldOp = geomGen->GetIFieldOperations();
     
       for ( int iM = 0; iM < meshes.count(); ++iM )
       {
    diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx
    index 4e7f6bf5f..00fdedfae 100755
    --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx
    @@ -1369,8 +1369,7 @@ void SMESHGUI_FilterTable::SetCriterion (const int                       theRow,
       {
         if ( strlen( theCriterion.ThresholdID ) > 0 ) // shape ID -> name
         {
    -      _PTR(SObject) sobj =
    -        SMESH::GetActiveStudyDocument()->FindObjectID( theCriterion.ThresholdID.in() );
    +      _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( theCriterion.ThresholdID.in() );
           if ( !sobj )
             aTable->item( theRow, 2 )->setText( QString( theCriterion.ThresholdID ) );
           else
    @@ -3195,8 +3194,7 @@ bool SMESHGUI_FilterDlg::isValid() const
           QString aName;
           myTable->GetThreshold(i, aName);
     
    -      std::vector<_PTR(SObject)> aList =
    -        SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
    +      std::vector<_PTR(SObject)> aList = SMESH::getStudy()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
           if (aList.size() == 0) {
             SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
                                          tr("BAD_SHAPE_NAME").arg(aName));
    diff --git a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx
    index 5ec69fed3..a23d80aa3 100644
    --- a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx
    @@ -495,7 +495,7 @@ void SMESHGUI_FindElemByPointOp::onSelectionDone()
         if (aList.Extent() == 1 && aList.First()->hasEntry())
         {
           Handle(SALOME_InteractiveObject) anIO = aList.First();
    -      _PTR(SObject) pObj = studyDS()->FindObjectID(anIO->getEntry());
    +      _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID(anIO->getEntry());
           CORBA::Object_var anObj = SMESH::IObjectToObject( anIO );
           newMeshEntry = anIO->getEntry();
           SMESH::SMESH_IDSource_var aMeshOrPart = SMESH::SMESH_IDSource::_narrow(anObj);
    diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx
    index 974b54ff8..536742006 100644
    --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx
    +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx
    @@ -93,11 +93,7 @@ namespace SMESH
         if ( !aMeshShape->_is_nil() )
           return aMeshShape;
     
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    -    if (!aStudy)
    -      return aMeshShape;
    -
    -    _PTR(ChildIterator) anIter (aStudy->NewChildIterator(theSO));
    +    _PTR(ChildIterator) anIter (SMESH::getStudy()->NewChildIterator(theSO));
         for ( ; anIter->More(); anIter->Next()) {
           _PTR(SObject) aSObject = anIter->Value();
           _PTR(SObject) aRefSOClient;
    @@ -120,11 +116,7 @@ namespace SMESH
         if (!smeshSO)
           return 0;
     
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    -    if (!aStudy)
    -      return 0;
    -
    -    _PTR(ChildIterator) anIter (aStudy->NewChildIterator( smeshSO ));
    +    _PTR(ChildIterator) anIter (SMESH::getStudy()->NewChildIterator( smeshSO ));
         for ( ; anIter->More(); anIter->Next()) {
           _PTR(SObject) aSObject = anIter->Value();
           _PTR(SObject) aRefSOClient;
    @@ -153,11 +145,10 @@ namespace SMESH
                                          long                  theID)
       {
         GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    -    if (!aStudy || geomGen->_is_nil())
    +    if (geomGen->_is_nil())
           return GEOM::GEOM_Object::_nil();
         GEOM::GEOM_IShapesOperations_wrap aShapesOp =
    -      geomGen->GetIShapesOperations(aStudy->StudyId());
    +      geomGen->GetIShapesOperations();
         if (aShapesOp->_is_nil())
           return GEOM::GEOM_Object::_nil();
         GEOM::GEOM_Object_wrap subShape = aShapesOp->GetSubShape (theMainShape,theID);
    @@ -183,10 +174,7 @@ namespace SMESH
         meshGeom.clear();
         if ( hypIO.IsNull() ) return false;
     
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    -    if ( !aStudy ) return false;
    -
    -    _PTR(SObject) hypSO = aStudy->FindObjectID( hypIO->getEntry() );
    +    _PTR(SObject) hypSO = SMESH::getStudy()->FindObjectID( hypIO->getEntry() );
         if ( !hypSO ) return false;
     
         // Depth() is a number of fathers
    diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx
    index c7d806b7d..ce7f8b88a 100644
    --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx
    @@ -498,10 +498,7 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
       QString aName = "";
     
       // collect all object names of SMESH component
    -  SalomeApp_Study* appStudy =
    -    dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() );
    -  if ( !appStudy ) return aName;
    -  _PTR(Study) aStudy = appStudy->studyDS();
    +  _PTR(Study) aStudy = SMESH::getStudy();
     
       std::set aSet;
       _PTR(SComponent) aMeshCompo (aStudy->FindComponent( "SMESH" ));
    @@ -528,14 +525,13 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
     void  SMESHGUI_GroupDlg::setDefaultName() const
     {
       QString aResName;
    -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
       int i=1;
       QString aPrefix ="Group_";
       _PTR(SObject) anObj;
       do
       {
         aResName = aPrefix + QString::number( i++ );
    -    anObj = aStudy->FindObject( SMESH::toUtf8(aResName) );
    +    anObj = SMESH::getStudy()->FindObject( SMESH::toUtf8(aResName) );
       }
       while ( anObj );
       myName->setText(aResName); 
    @@ -664,7 +660,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
       else if ( grpType == 1 ) // group on geom
       {
         QString aShapeName( "" );
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +    _PTR(Study) aStudy = SMESH::getStudy();
         GEOM::GEOM_Object_var aGroupShape = myGroupOnGeom->GetShape();
         if (!aGroupShape->_is_nil())
         {
    @@ -915,7 +911,7 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
     //=================================================================================
     bool SMESHGUI_GroupDlg::onApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if (myName->text().trimmed().isEmpty())
    @@ -1050,7 +1046,7 @@ bool SMESHGUI_GroupDlg::onApply()
           if (myMesh->_is_nil() || !myGeomObjects->length())
             return false;
     
    -      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +      _PTR(Study) aStudy = SMESH::getStudy();
     
           if (myGeomObjects->length() == 1) {
             myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
    @@ -1064,12 +1060,11 @@ bool SMESHGUI_GroupDlg::onApply()
     
             // create a geometry group
             GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
    -        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
     
    -        if (geomGen->_is_nil() || !aStudy)
    +        if (geomGen->_is_nil())
               return false;
     
    -        GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(aStudy->StudyId());
    +        GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
             if (op->_is_nil())
               return false;
     
    @@ -1095,7 +1090,7 @@ bool SMESHGUI_GroupDlg::onApply()
               QString aNewGeomGroupName ( "Auto_group_for_" );
               aNewGeomGroupName += myName->text();
               SALOMEDS::SObject_var aNewGroupSO =
    -            geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
    +            geomGen->AddInStudy(aGroupVar,
                                     SMESH::toUtf8(aNewGeomGroupName), aMeshShape);
             }
     
    @@ -1412,13 +1407,12 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
               continue;
     
             // Check if group constructed on the same shape as a mesh or on its child
    -        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
     
             // The main shape of the group
             GEOM::GEOM_Object_var aGroupMainShape;
             if (aGeomGroup->GetType() == 37) {
               GEOM::GEOM_IGroupOperations_wrap anOp =
    -            SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
    +            SMESH::GetGEOMGen()->GetIGroupOperations();
               aGroupMainShape = anOp->GetMainShape(aGeomGroup);
               // aGroupMainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
             }
    @@ -1427,7 +1421,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
               aGroupMainShape->Register();
             }
             _PTR(SObject) aGroupMainShapeSO =
    -          aStudy->FindObjectID(aGroupMainShape->GetStudyEntry());
    +          SMESH::getStudy()->FindObjectID(aGroupMainShape->GetStudyEntry());
     
             _PTR(SObject) anObj, aRef;
             bool isRefOrSubShape = false;
    @@ -2006,9 +2000,8 @@ void SMESHGUI_GroupDlg::onAdd()
         onListSelectionChanged();
     
       } else if (myCurrentLineEdit == myGeomGroupLine && myGeomObjects->length() == 1) {
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
         GEOM::GEOM_IGroupOperations_wrap aGroupOp =
    -      SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
    +      SMESH::GetGEOMGen()->GetIGroupOperations();
     
         SMESH::ElementType aGroupType = SMESH::ALL;
         switch(aGroupOp->GetType(myGeomObjects[0])) {
    @@ -2021,8 +2014,8 @@ void SMESHGUI_GroupDlg::onAdd()
     
         if (aGroupType == aType) {
           _PTR(SObject) aGroupSO =
    -        //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
    -        aStudy->FindObjectID(myGeomObjects[0]->GetStudyEntry());
    +        //SMESH::getStudy()->FindObjectIOR(SMESH::getStudy()->ConvertObjectToIOR(myGeomGroup));
    +        SMESH::getStudy()->FindObjectID(myGeomObjects[0]->GetStudyEntry());
           // Construct filter
           SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
           SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
    @@ -2454,8 +2447,7 @@ void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op)
         if ( !aGeomVar->_is_nil() )
         {
           QString ID = aGeomVar->GetStudyEntry();
    -      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    -      if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
    +      if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) {
             SALOME_ListIO anIOList;
             Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
               ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
    diff --git a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx
    index dc1461cda..aaf5f6801 100644
    --- a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx
    @@ -219,13 +219,12 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var geom)
         case GEOM::COMPOUND: break;
         default:             return SMESH::ALL;
         }
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
         GEOM::GEOM_IShapesOperations_wrap aShapeOp =
    -      SMESH::GetGEOMGen()->GetIShapesOperations(aStudy->StudyId());
    +      SMESH::GetGEOMGen()->GetIShapesOperations();
     
         if ( geom->GetType() == 37 ) { // geom group
           GEOM::GEOM_IGroupOperations_wrap aGroupOp =
    -        SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
    +        SMESH::GetGEOMGen()->GetIGroupOperations();
           if ( !aGroupOp->_is_nil() ) {
             // mainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
             GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom );
    @@ -296,11 +295,11 @@ bool SMESHGUI_GroupOnShapeOp::onApply()
     {
       SUIT_OverrideCursor aWaitCursor;
     
    -  if (isStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       // study
    -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +  _PTR(Study) aStudy = SMESH::getStudy();
       if ( !aStudy ) return false;
     
       // mesh
    @@ -460,7 +459,7 @@ void SMESHGUI_GroupOnShapeOp::selectionDone()
       QStringList goodNames, goodIds;
       if (nbSelected > 0) {
         // study
    -    if (_PTR(Study) aStudy = SMESH::GetActiveStudyDocument()) {
    +    if (_PTR(Study) aStudy = SMESH::getStudy()) {
           // mesh
           if (_PTR(SObject)  meshSO = aStudy->FindObjectID( myMeshID.toLatin1().data() )) {
             // shape to mesh
    diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
    index 915933dc4..b4084b665 100644
    --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
    @@ -629,7 +629,7 @@ void SMESHGUI_UnionGroupsDlg::reset()
     */
     bool SMESHGUI_UnionGroupsDlg::onApply()
     {
    -  if ( getSMESHGUI()->isActiveStudyLocked())
    +  if ( SMESHGUI::isStudyLocked())
         return false;
     
       // Verify validity of group name
    @@ -738,7 +738,7 @@ void SMESHGUI_IntersectGroupsDlg::reset()
     */
     bool SMESHGUI_IntersectGroupsDlg::onApply()
     {
    -  if ( getSMESHGUI()->isActiveStudyLocked())
    +  if ( SMESHGUI::isStudyLocked())
         return false;
     
       // Verify validity of group name
    @@ -898,7 +898,7 @@ void SMESHGUI_CutGroupsDlg::reset()
     */
     bool SMESHGUI_CutGroupsDlg::onApply()
     {
    -  if ( getSMESHGUI()->isActiveStudyLocked())
    +  if ( SMESHGUI::isStudyLocked())
         return false;
     
       // Verify validity of group name
    @@ -1088,7 +1088,7 @@ void SMESHGUI_DimGroupDlg::setElementType( const SMESH::ElementType& theElemType
     */
     bool SMESHGUI_DimGroupDlg::onApply()
     {
    -  if ( getSMESHGUI()->isActiveStudyLocked())
    +  if ( SMESHGUI::isStudyLocked())
         return false;
     
       // Verify validity of group name
    diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx
    index f313c8ce2..bbb79cfe3 100644
    --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx
    +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx
    @@ -213,7 +213,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
           case QVariant::String:
             {
               if((*anIt).isVariable) {
    -            _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +            _PTR(Study) aStudy = SMESH::getStudy();
                 QString aVar = (*anIt).myValue.toString();
                 if(aStudy->IsInteger(aVar.toLatin1().constData())){
                   SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
    @@ -298,7 +298,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
       {
         //remove just created hypothesis
         _PTR(SObject) aHypSObject = SMESH::FindSObject( myHypo );
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +    _PTR(Study) aStudy = SMESH::getStudy();
         if( aStudy && !aStudy->GetProperties()->IsLocked() )
         {
           _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
    diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
    index 021e003b9..12668b5bf 100644
    --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
    +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
    @@ -701,7 +701,7 @@ namespace SMESH
         SUIT_OverrideCursor wc;
     
         try {
    -      _PTR(Study) aStudy = GetActiveStudyDocument();
    +      _PTR(Study) aStudy = getStudy();
           _PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
           if( aHypObj )
           {
    @@ -785,8 +785,7 @@ namespace SMESH
         if (!AlgoOrHyp->_is_nil()) {
           _PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp);
           if (SO_Hypothesis) {
    -        SObjectList listSO =
    -          SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
    +        SObjectList listSO = SMESH::getStudy()->FindDependances(SO_Hypothesis);
     
             if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<studyDS()->FindObjectID( ids[i].toLatin1().constData() );
    +        _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( ids[i].toLatin1().constData() );
             mySrcMesh = SMESH::SObjectToInterface( sobj );  
             //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh
           }
    @@ -356,7 +355,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const
         for ( int i = 0; i < entries.count(); ++i )
         {
           SMESH::SMESH_GroupBase_var grp;
    -      if ( _PTR(SObject) sobj = SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() ))
    +      if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() ))
             grp = SMESH::SObjectToInterface( sobj );
           if ( grp->_is_nil() ) {
             msg = tr( "SMESH_NOT_ONLY_GROUPS" );
    @@ -370,7 +369,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const
       for ( int i = 0; i < entries.count(); ++i )
       {
         SMESH::SMESH_IDSource_var idSource;
    -    if ( _PTR(SObject) sobj = SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() ))
    +    if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() ))
           idSource = SMESH::SObjectToInterface( sobj );
         if ( !idSource->_is_nil() ) {
           SMESH::array_of_ElementType_var types = idSource->GetTypes();
    @@ -428,8 +427,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList )
           groups->length( entries.count() );
           for ( int i = 0; i < entries.count(); ++i )
           {
    -        _PTR(SObject) sobj =
    -          SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() );
    +        _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() );
             SMESH::SMESH_IDSource_var grp = SMESH::SObjectToInterface( sobj );  
             SMESH::array_of_ElementType_var types = grp->GetTypes();
             if ( types->length() < 1 || types[0] != goodType )
    @@ -482,7 +480,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList )
     
     bool SMESHGUI_Make2DFrom3DOp::onApply()
     {
    -  if ( isStudyLocked() )
    +  if ( SMESHGUI::isStudyLocked() )
         return false;
     
       QString msg;
    diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
    index 385bb8f1b..cd5a89ff5 100644
    --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
    @@ -493,7 +493,7 @@ void SMESHGUI_MakeNodeAtPointOp::stopOperation()
     
     bool SMESHGUI_MakeNodeAtPointOp::onApply()
     {
    -  if( isStudyLocked() )
    +  if( SMESHGUI::isStudyLocked() )
         return false;
     
       if ( !myMeshActor ) {
    diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx
    index 2aba558af..d25b65970 100644
    --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx
    @@ -511,7 +511,7 @@ void SMESHGUI_MergeDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
     //=================================================================================
     bool SMESHGUI_MergeDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked() || myMesh->_is_nil())
    +  if (SMESHGUI::isStudyLocked() || myMesh->_is_nil())
         return false;
     
       try {
    diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx
    index 299ba97c0..610ccc08c 100644
    --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx
    +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx
    @@ -3216,12 +3216,6 @@ void SMESHGUI_MeshInfoDlg::showItemInfo( const QString& theStr )
     
     void SMESHGUI_MeshInfoDlg::dump()
     {
    -  SUIT_Application* app = SUIT_Session::session()->activeApplication();
    -  if ( !app ) return;
    -  SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() );
    -  if ( !appStudy ) return;
    -  _PTR( Study ) aStudy = appStudy->studyDS();
    -
       QStringList aFilters;
       aFilters.append( tr( "TEXT_FILES" ));
     
    @@ -3973,12 +3967,6 @@ void SMESHGUI_CtrlInfoDlg::deactivate()
      */
     void SMESHGUI_CtrlInfoDlg::dump()
     {
    -  SUIT_Application* app = SUIT_Session::session()->activeApplication();
    -  if ( !app ) return;
    -  SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() );
    -  if ( !appStudy ) return;
    -  _PTR( Study ) aStudy = appStudy->studyDS();
    -
       QStringList aFilters;
       aFilters.append( tr( "TEXT_FILES" ));
     
    diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx
    index 43d92b9fc..f9f5ab83a 100644
    --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx
    +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx
    @@ -133,7 +133,7 @@ LightApp_Dialog* SMESHGUI_MeshOp::dlg() const
     //================================================================================
     bool SMESHGUI_MeshOp::onApply()
     {
    -  if (isStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       QString aMess;
    @@ -227,7 +227,7 @@ void SMESHGUI_MeshOp::startOperation()
       }
       SMESHGUI_SelectionOp::startOperation();
       // iterate through dimensions and get available algorithms, set them to the dialog
    -  _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
    +  _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent( "SMESH" );
       for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ )
       {
         SMESHGUI_MeshTab* aTab = myDlg->tab( i );
    @@ -329,7 +329,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
     
       // mesh
       QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
    -  _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
    +  _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
       if (!pMesh) return false;
     
       SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface( pMesh );
    @@ -345,17 +345,16 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
     
       if (aGEOMs.count() > 0) {
         GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    -    if (geomGen->_is_nil() || !aStudy) return false;
    +    if (geomGen->_is_nil()) return false;
     
    -    GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(aStudy->StudyId());
    +    GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
         if (op->_is_nil()) return false;
     
         // check all selected shapes
         QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
         for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) {
           QString aSubGeomEntry = (*aSubShapesIter);
    -      _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
    +      _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
           if (!pSubGeom) return false;
     
           GEOM::GEOM_Object_var aSubGeomVar =
    @@ -375,7 +374,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
           if ( aSubGeomVar->GetShapeType() == GEOM::COMPOUND )
           {
             // is aSubGeomVar a compound of sub-shapes?
    -        GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations(aStudy->StudyId());
    +        GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations();
             if (sop->_is_nil()) return false;
             GEOM::ListOfLong_var ids = sop->GetAllSubShapesIDs( aSubGeomVar,
                                                                 GEOM::SHAPE,/*sorted=*/false);
    @@ -417,7 +416,7 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const
     
         QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
         QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
    -    _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
    +    _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
         if ( pMesh ) {
     
           QStringList algoNames;
    @@ -433,7 +432,7 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const
           }
     
     //       GEOM::GEOM_Object_var geom;
    -//       if (_PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() ))
    +//       if (_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ))
     //         geom = SMESH::SObjectToInterface( pGeom );
     
     //       if ( !geom->_is_nil() && geom->GetShapeType() >= GEOM::FACE ) { // WIRE, EDGE as well
    @@ -462,8 +461,8 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const
     {
       QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
       QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
    -  _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
    -  _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
    +  _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
    +  _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
       if ( pMesh && pGeom ) {
         GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface( pGeom );
         if ( !geom->_is_nil() ) {
    @@ -480,7 +479,7 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const
           }
           _PTR(GenericAttribute) anAttr;
           _PTR(SObject) aSubmeshRoot;
    -      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +      _PTR(Study) aStudy = SMESH::getStudy();
           if ( pMesh->FindSubObject( tag, aSubmeshRoot ) )
           {
             _PTR(ChildIterator) smIter = aStudy->NewChildIterator( aSubmeshRoot );
    @@ -523,7 +522,7 @@ void SMESHGUI_MeshOp::selectionDone()
     
         //Check geometry for mesh
         QString anObjEntry = myDlg->selectedObject(SMESHGUI_MeshDlg::Obj);
    -    _PTR(SObject) pObj = studyDS()->FindObjectID(anObjEntry.toLatin1().data());
    +    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID(anObjEntry.toLatin1().data());
         if (pObj)
         {
           SMESH::SMESH_Mesh_var aMeshVar =
    @@ -551,7 +550,7 @@ void SMESHGUI_MeshOp::selectionDone()
             int iSubSh = 0;
             for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
               QString aSubGeomEntry = (*aSubShapesIter);
    -          _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
    +          _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
              
               if( pSubGeom ) { 
                 SALOMEDS_SObject* sobj = _CAST(SObject,pSubGeom);
    @@ -567,7 +566,7 @@ void SMESHGUI_MeshOp::selectionDone()
           } else {
             // get geometry by selected sub-mesh
             QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
    -        _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
    +        _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
             GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
             if (!aGeomVar->_is_nil()) {
               aSeq->length(1);
    @@ -694,12 +693,12 @@ void SMESHGUI_MeshOp::selectionDone()
             // enable/disable popup for choice of geom selection way
             bool enable = false;
             QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
    -        if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
    +        if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
               SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface( pMesh );
               if ( !mesh->_is_nil() ) {
                 //rnv: issue 21056: EDF 1608 SMESH: Dialog Box "Create Sub Mesh": focus should automatically switch to geometry
                 QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
    -            _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
    +            _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
                 if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
                   myDlg->activateObject(SMESHGUI_MeshDlg::Geom);
                 enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 );
    @@ -774,7 +773,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
       {
         QString aMeshEntry = myDlg->selectedObject
           ( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
    -    if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
    +    if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
           SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface( pMesh );
           if ( !mesh->_is_nil() && CORBA::is_nil( mesh->GetShapeToMesh() )) {
             theMess = tr( "IMPORTED_MESH" );
    @@ -803,7 +802,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
           }
           return true;
         }
    -    _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
    +    _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
         if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
         {
           theMess = tr( "GEOMETRY_OBJECT_IS_NULL" );
    @@ -819,7 +818,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
             theMess = tr( "MESH_IS_NOT_DEFINED" );
             return false;
           }
    -      _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
    +      _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
           if ( !pMesh || SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() )->_is_nil() )
           {
             theMess = tr( "MESH_IS_NULL" );
    @@ -946,7 +945,7 @@ void SMESHGUI_MeshOp::availableHyps( const int       theDim,
       QString aCurrentGeomToSelect;
       if ( !theMeshType.isEmpty() ) {
         aCurrentGeomToSelect = myDlg->selectedObject( myToCreate ? SMESHGUI_MeshDlg::Geom : SMESHGUI_MeshDlg::Obj );
    -    if ( _PTR(SObject) so = studyDS()->FindObjectID( aCurrentGeomToSelect.toLatin1().data() )) {
    +    if ( _PTR(SObject) so = SMESH::getStudy()->FindObjectID( aCurrentGeomToSelect.toLatin1().data() )) {
           aGeomVar = SMESH::GetGeom( so );
         }
        if ( aCurrentGeomToSelect != myLastGeomToSelect )
    @@ -1050,8 +1049,7 @@ void SMESHGUI_MeshOp::existingHyps( const int       theDim,
     
       if ( theFather->FindSubObject( aPart, aHypRoot ) )
       {
    -    _PTR(ChildIterator) anIter =
    -      SMESH::GetActiveStudyDocument()->NewChildIterator( aHypRoot );
    +    _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypRoot );
         for ( ; anIter->More(); anIter->Next() )
         {
           _PTR(SObject) anObj = anIter->Value();
    @@ -1122,14 +1120,14 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
       {
         anEntry = myDlg->selectedObject
           ( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
    -    if ( _PTR(SObject) pObj = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
    +    if ( _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
         {
           CORBA::Object_ptr Obj = _CAST( SObject,pObj )->GetObject();
           if ( myToCreate ) // mesh and geom may be selected
           {
             aMeshVar = SMESH::SMESH_Mesh::_narrow( Obj );
             anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
    -        if ( _PTR(SObject) pGeom = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
    +        if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
               aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
           }
           else // edition: sub-mesh may be selected
    @@ -1147,7 +1145,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
         if ( !myToCreate ) // mesh to edit can be selected
         {
           anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
    -      if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
    +      if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
           {
             aMeshVar = SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
             if ( !aMeshVar->_is_nil() )
    @@ -1156,7 +1154,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
         }
         if ( aGeomVar->_is_nil() ) {
           anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
    -      if ( _PTR(SObject) pGeom = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
    +      if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
           {
             aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
           }
    @@ -1199,13 +1197,13 @@ void SMESHGUI_MeshOp::initHypCreator( SMESHGUI_GenericHypothesisCreator* theCrea
         aMeshEntry = aGeomEntry;
     
       if ( aMeshEntry != aGeomEntry ) { // Get Geom object from Mesh of a sub-mesh being edited
    -    _PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
    +    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
         GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
         aMeshEntry = ( aGeomVar->_is_nil() ) ? QString() : SMESH::toQStr( aGeomVar->GetStudyEntry() );
       }
     
       if ( aMeshEntry == "" && aGeomEntry == "" ) { // get geom of an object being edited
    -    _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
    +    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
         bool isMesh;
         GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj, &isMesh );
         if ( !aGeomVar->_is_nil() )
    @@ -1218,7 +1216,7 @@ void SMESHGUI_MeshOp::initHypCreator( SMESHGUI_GenericHypothesisCreator* theCrea
     
       if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) {
         // take geometry from submesh being created
    -    _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
    +    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
         if ( pObj ) {
           // if current object is sub-mesh
           SMESH::SMESH_subMesh_var aSubMeshVar =
    @@ -1396,7 +1394,7 @@ void SMESHGUI_MeshOp::onHypoCreated( int result )
         myDlg->setEnabled( true );
       }
     
    -  _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
    +  _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent("SMESH");
     
       int nbHyp = myExistingHyps[myDim][myType].count();
       HypothesisData* algoData = hypData( myDim, Algo, currentHyp( myDim, Algo ));
    @@ -1610,7 +1608,7 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
     
       // set hypotheses corresponding to the found algorithms
     
    -  _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
    +  _PTR(SObject) pObj = SMESH::getStudy()->FindComponent("SMESH");
     
       for ( int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++ )
       {
    @@ -1829,7 +1827,7 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess, QStringList& theEntryList )
       for ( int i = 0; it!=aList.end(); it++, ++i )
       {
         QString aGeomEntry = *it;
    -    _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
    +    _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
         GEOM::GEOM_Object_var aGeomVar =
           GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
     
    @@ -1896,7 +1894,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
     
       // get mesh object
       QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
    -  _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
    +  _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
       SMESH::SMESH_Mesh_var aMeshVar =
         SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
       if (aMeshVar->_is_nil())
    @@ -1916,17 +1914,16 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
       {
         //QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
         QString aGeomEntry = aGEOMs.first();
    -    _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
    +    _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
         aGeomVar = GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
       }
       else if (aGEOMs.count() > 1)
       {
         // create a GEOM group
         GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    -    if (!geomGen->_is_nil() && aStudy) {
    +    if (!geomGen->_is_nil()) {
           GEOM::GEOM_IGroupOperations_wrap op =
    -        geomGen->GetIGroupOperations(aStudy->StudyId());
    +        geomGen->GetIGroupOperations();
           if (!op->_is_nil()) {
             // check and add all selected GEOM objects: they must be
             // a sub-shapes of the main GEOM and must be of one type
    @@ -1937,7 +1934,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
             QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
             for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
               QString aSubGeomEntry = (*aSubShapesIter);
    -          _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
    +          _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
               GEOM::GEOM_Object_var aSubGeomVar =
                 GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject());
               TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aSubGeomVar->GetShapeType();
    @@ -1960,9 +1957,8 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
               // publish the GEOM group in study
               QString aNewGeomGroupName ("Auto_group_for_");
               aNewGeomGroupName += aName;
    -          SALOMEDS::Study_var aStudyVar = _CAST(Study, aStudy)->GetStudy();
               SALOMEDS::SObject_wrap aNewGroupSO =
    -            geomGen->AddInStudy( aStudyVar, aGeomVar,
    +            geomGen->AddInStudy( aGeomVar,
                                      aNewGeomGroupName.toLatin1().data(), mainGeom);
             }
           }
    @@ -2117,7 +2113,7 @@ void SMESHGUI_MeshOp::setDefaultName( const QString& thePrefix ) const
     {
       QString aResName;
     
    -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +  _PTR(Study) aStudy = SMESH::getStudy();
       int i = 1;
     
       QString aPrefix = thePrefix;
    @@ -2158,7 +2154,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
       QString aHypName = dataList[ aHypIndex ]->TypeName;
     
       // get existing algorithms
    -  _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
    +  _PTR(SObject) pObj = SMESH::getStudy()->FindComponent("SMESH");
       QStringList tmp;
       existingHyps( theDim, Algo, pObj, tmp, myExistingHyps[ theDim ][ Algo ]);
     
    @@ -2204,7 +2200,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
             delete aCreator;
           }
           QStringList tmpList;
    -      _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
    +      _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent( "SMESH" );
           existingHyps( theDim, Algo, aFather, tmpList, myExistingHyps[ theDim ][ Algo ] );
         }
     
    @@ -2233,7 +2229,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
     void SMESHGUI_MeshOp::readMesh()
     {
       QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
    -  _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
    +  _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
       if ( !pObj )
         return;
     
    @@ -2399,7 +2395,7 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess )
         return false;
     
       QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
    -  _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
    +  _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
       if ( !pObj )
         return false;
     
    @@ -2582,7 +2578,7 @@ void SMESHGUI_MeshOp::onGeomSelectionByMesh( bool theByMesh )
         }
         // set mesh object to SMESHGUI_ShapeByMeshOp and start it
         QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
    -    if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
    +    if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
           SMESH::SMESH_Mesh_var aMeshVar =
             SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
           if ( !aMeshVar->_is_nil() ) {
    @@ -2611,7 +2607,7 @@ void SMESHGUI_MeshOp::onPublishShapeByMeshDlg(SUIT_Operation* op)
         if ( !aGeomVar->_is_nil() )
         {
           QString ID = SMESH::toQStr( aGeomVar->GetStudyEntry() );
    -      if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID.toLatin1().data() )) {
    +      if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) {
             selectObject( aGeomSO );
             selectionDone();
           }
    diff --git a/src/SMESHGUI/SMESHGUI_MeshOrderOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOrderOp.cxx
    index eec510cea..cab1695a5 100644
    --- a/src/SMESHGUI/SMESHGUI_MeshOrderOp.cxx
    +++ b/src/SMESHGUI/SMESHGUI_MeshOrderOp.cxx
    @@ -280,7 +280,7 @@ bool SMESHGUI_MeshOrderMgr::SetMeshOrder( const  ListListId& theListListIds )
       if (theListListIds.isEmpty() || myMesh->_is_nil())
         return false;
     
    -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +  _PTR(Study) aStudy = SMESH::getStudy();
       _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
       if ( !aStudy || !aMeshSObj )
         return false;
    diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
    index 53e60ce65..8b0bd227c 100755
    --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
    @@ -504,7 +504,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
             _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
             SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
             if (!anActor) {
    -          anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
    +          anActor = SMESH::CreateActor(aSO->GetID().c_str());
               if (anActor) {
                 SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
                 SMESH::FitAll();
    diff --git a/src/SMESHGUI/SMESHGUI_MeshUtils.cxx b/src/SMESHGUI/SMESHGUI_MeshUtils.cxx
    index 9b3d606a0..0e322fc4a 100644
    --- a/src/SMESHGUI/SMESHGUI_MeshUtils.cxx
    +++ b/src/SMESHGUI/SMESHGUI_MeshUtils.cxx
    @@ -64,7 +64,7 @@ namespace SMESH
       {
         QString baseName = thePostfix.isEmpty() ? 
           theBaseName : theBaseName + "_" + thePostfix;
    -    if ( _PTR(Study) aStudy = GetActiveStudyDocument() ) {
    +    if ( _PTR(Study) aStudy = getStudy() ) {
           QString name = baseName;
           while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
             int nb = 0;
    @@ -90,7 +90,7 @@ namespace SMESH
         QString baseName = thePostfix.isEmpty() ? 
           theBaseName : theBaseName + "_" + thePostfix;
         QString name = baseName;
    -    if ( _PTR(Study) aStudy = GetActiveStudyDocument() ) {
    +    if ( _PTR(Study) aStudy = getStudy() ) {
           _PTR(SObject) p = theParent;
           if ( !p ) p = aStudy->FindComponent( "SMESH" );
           if ( p ) {
    diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
    index f31874bb0..1f1ee9efc 100755
    --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
    @@ -995,7 +995,7 @@ void SMESHGUI_MultiEditDlg::setSelectionMode()
     //=======================================================================
     bool SMESHGUI_MultiEditDlg::onApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
       if (!isValid(true))
         return false;
    diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx
    index 0e6bd0d98..5f2f2d921 100644
    --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx
    @@ -102,9 +102,7 @@ namespace SMESH
           SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
           theMesh->SetParameters( theParameters.join(":").toLatin1().constData() );
           aNodeId = aMeshEditor->AddNode( x, y, z );
    -      _PTR(Study) aStudy = GetActiveStudyDocument();
    -      CORBA::Long anId = aStudy->StudyId();
    -      if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
    +      if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( aSobj->GetID().c_str() ) ) {
             aVisualObj->Update( true );
           }
         } 
    @@ -423,7 +421,7 @@ void SMESHGUI_NodesDlg::ClickOnOk()
     //=================================================================================
     bool SMESHGUI_NodesDlg::ClickOnApply()
     {
    -  if ( mySMESHGUI->isActiveStudyLocked() )
    +  if ( SMESHGUI::isStudyLocked() )
         return false;
     
       if ( myMesh->_is_nil() ) {
    diff --git a/src/SMESHGUI/SMESHGUI_Operation.cxx b/src/SMESHGUI/SMESHGUI_Operation.cxx
    index 0a6b8bc27..2b604b0eb 100755
    --- a/src/SMESHGUI/SMESHGUI_Operation.cxx
    +++ b/src/SMESHGUI/SMESHGUI_Operation.cxx
    @@ -122,7 +122,7 @@ bool SMESHGUI_Operation::isReadyToStart() const
                                   tr( "NO_MODULE" ) );
         return false;
       }
    -  else if ( isStudyLocked() )
    +  else if ( SMESHGUI::isStudyLocked() )
         return false;
     
       return true;
    @@ -142,16 +142,6 @@ void SMESHGUI_Operation::setDialogActive( const bool active )
     
     }
     
    -//=======================================================================
    -// name    : studyDS
    -// Purpose :
    -//=======================================================================
    -_PTR(Study) SMESHGUI_Operation::studyDS() const
    -{
    -  SalomeApp_Study* s = dynamic_cast( study() );
    -  return s->studyDS();
    -}
    -
     //=======================================================================
     // name    : onOk
     // Purpose :
    @@ -236,30 +226,6 @@ bool SMESHGUI_Operation::isApplyAndClose() const
       return myIsApplyAndClose;
     }
     
    -/*!
    - * \brief Verifies whether study of operation is locked
    -  * \param theMess - specifies whether message box must be shown if study is locked
    -  * \return State of study.
    -*
    -* Verifies whether study of operation is locked. If second parameter is TRUE and study
    -* is locked when corresponding message box appears
    -*/
    -bool SMESHGUI_Operation::isStudyLocked( const bool theMess ) const
    -{
    -  if ( studyDS() )
    -  {
    -    if ( studyDS()->GetProperties()->IsLocked() )
    -    {
    -      if ( theMess )
    -        SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
    -                                  tr( "WRN_STUDY_LOCKED" ) );
    -      return true;
    -    }
    -  }
    -
    -  return false;
    -}
    -
     /*!
      * \brief Verifies whether given operator is valid for this one
       * \param theOtherOp - other operation
    diff --git a/src/SMESHGUI/SMESHGUI_Operation.h b/src/SMESHGUI/SMESHGUI_Operation.h
    index 990759dc8..3f3e89151 100755
    --- a/src/SMESHGUI/SMESHGUI_Operation.h
    +++ b/src/SMESHGUI/SMESHGUI_Operation.h
    @@ -65,9 +65,6 @@ protected:
       virtual void      setDialogActive( const bool );
     
       SMESHGUI*         getSMESHGUI() const;
    -  bool              isStudyLocked( const bool = true ) const;
    -
    -  _PTR(Study)       studyDS() const;
       
       virtual bool      isValid( SUIT_Operation* ) const;
     
    diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
    index 067eb5f49..620996d18 100644
    --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
    @@ -223,7 +223,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
     //=================================================================================
     void SMESHGUI_RemoveElementsDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return;
     
       if (myNbOkElements)
    diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
    index 805b37c85..a94f4b488 100644
    --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
    @@ -229,7 +229,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
     //=================================================================================
     void SMESHGUI_RemoveNodesDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return;
     
       if (myNbOkNodes) {
    diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx
    index 5dc81e40e..9f2144674 100644
    --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx
    @@ -210,7 +210,7 @@ void SMESHGUI_RenumberingDlg::Init()
     //=================================================================================
     void SMESHGUI_RenumberingDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return;
     
       if (!myMesh->_is_nil()) {
    diff --git a/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx b/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx
    index cb3828246..f6f72edb2 100644
    --- a/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx
    @@ -638,7 +638,7 @@ void SMESHGUI_ReorientFacesOp::onTextChange( const QString& theText )
     
     bool SMESHGUI_ReorientFacesOp::onApply()
     {
    -  if( isStudyLocked() )
    +  if( SMESHGUI::isStudyLocked() )
         return false;
     
       QString msg;
    @@ -728,7 +728,7 @@ bool SMESHGUI_ReorientFacesOp::isValid( QString& msg )
     {
       // check object
       QString objectEntry = myDlg->selectedObject( EObject );
    -  _PTR(SObject) pSObject = studyDS()->FindObjectID( objectEntry.toLatin1().data() );
    +  _PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toLatin1().data() );
       myObject = SMESH::SMESH_IDSource::_narrow( _CAST( SObject,pSObject )->GetObject() );
       if ( myObject->_is_nil() )
       {
    @@ -749,7 +749,7 @@ bool SMESHGUI_ReorientFacesOp::isValid( QString& msg )
       if ( myDlg->myConstructorGrp->checkedId() == CONSTRUCTOR_VOLUME )
       {
         objectEntry = myDlg->selectedObject( EVolumes );
    -    _PTR(SObject) pSObject = studyDS()->FindObjectID( objectEntry.toLatin1().data() );
    +    _PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toLatin1().data() );
         myVolumeObj = SMESH::SObjectToInterface< SMESH::SMESH_IDSource>( pSObject );
         if ( myVolumeObj->_is_nil() )
         {
    diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
    index 27dfe0af0..f23c6d2f6 100644
    --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
    @@ -392,7 +392,7 @@ bool SMESHGUI_RevolutionDlg::isValid()
     //=================================================================================
     bool SMESHGUI_RevolutionDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if (!isValid())
    diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx
    index 48e7204cb..291d908dd 100644
    --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx
    @@ -400,7 +400,7 @@ void SMESHGUI_RotationDlg::Init (bool ResetControls)
     //=================================================================================
     bool SMESHGUI_RotationDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if( !isValid() )
    diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
    index 85e9dd46c..001ee7d94 100644
    --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
    @@ -439,7 +439,7 @@ void SMESHGUI_ScaleDlg::ConstructorsClicked (int constructorId)
     //=================================================================================
     bool SMESHGUI_ScaleDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if( !isValid() )
    diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx
    index b6976df86..0b113839d 100644
    --- a/src/SMESHGUI/SMESHGUI_Selection.cxx
    +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx
    @@ -40,7 +40,7 @@
     #include 
     
     // SALOME GUI includes
    -#include 
    +#include 
     #include 
     #include 
     
    @@ -75,15 +75,10 @@ void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr
     {
       LightApp_Selection::init( client, mgr );
     
    -  if( mgr && study() )
    +  if( mgr )
       {
    -    SalomeApp_Study* aSStudy = dynamic_cast(study());
    -    if (!aSStudy)
    -      return;
    -    _PTR(Study) aStudy = aSStudy->studyDS();
    -
         for( int i=0, n=count(); i SMESHGUI_Selection::elemTypes( int ind, bool fromObj ) const
       {
         if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
         {
    -      _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    -      CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
    +      _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
    +      CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
           SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
           if ( !CORBA::is_nil( idSrc ) )
           {
    @@ -268,7 +263,7 @@ QString SMESHGUI_Selection::displayMode( int ind ) const
     
     bool SMESHGUI_Selection::isQuadratic( int ind ) const
     {
    -  _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    +  _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
       if ( !so )
         return false;
       SMESH::SMESH_IDSource_var idSource =  SMESH::SObjectToInterface( so );
    @@ -463,11 +458,14 @@ bool SMESHGUI_Selection::isAutoColor( int ind ) const
     {
       if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
       {
    -    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    -    CORBA::Object_var      obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
    -    SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
    -    if ( !CORBA::is_nil( mesh ) )
    -      return mesh->GetAutoColor();
    +    _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
    +    CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
    +
    +    if ( !CORBA::is_nil( obj ) ) {
    +      SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
    +      if ( !CORBA::is_nil( mesh ) )
    +        return mesh->GetAutoColor();
    +    }
       }
       return false;
     }
    @@ -481,8 +479,8 @@ int SMESHGUI_Selection::numberOfNodes( int ind ) const
     {
       if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
       {
    -    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    -    CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
    +    _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
    +    CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
     
         if ( !CORBA::is_nil( obj ) ) {
           SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
    @@ -512,8 +510,8 @@ int SMESHGUI_Selection::dim( int ind ) const
       int dim = -1;
       if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
       {
    -    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    -    CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
    +    _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
    +    CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
     
         if ( !CORBA::is_nil( obj ) ) {
           SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
    @@ -547,7 +545,7 @@ bool SMESHGUI_Selection::isComputable( int ind ) const
                                                   myTypes[ind].startsWith("Mesh " )))
       {
         QMap modeMap;
    -    _PTR(SObject) meshSO = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    +    _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
     
         _PTR(SComponent) component = meshSO->GetFatherComponent();
         if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh
    @@ -573,7 +571,7 @@ bool SMESHGUI_Selection::isPreComputable( int ind ) const
         if ( maxDim < 2 ) // we can preview 1D or 2D
         {
           QMap modeMap;
    -      _PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    +      _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
           SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
           if ( modeMap.size() > 1 )
             return (( modeMap.contains( SMESH::DIM_3D )) ||
    @@ -592,7 +590,7 @@ bool SMESHGUI_Selection::hasGeomReference( int ind ) const
     {
       if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
       {
    -    _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    +    _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
         GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
         return !shape->_is_nil();
       }
    @@ -609,7 +607,7 @@ bool SMESHGUI_Selection::isEditableHyp( int ind ) const
       bool isEditable = true;
       if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Hypothesis" )
       {
    -    _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    +    _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
         SMESH::SMESH_Hypothesis_var hyp = SMESH::SObjectToInterface( so );
         if ( !hyp->_is_nil() )
         {
    @@ -646,9 +644,9 @@ bool SMESHGUI_Selection::hasChildren( int ind ) const
     {
       if ( ind >= 0 )
       {
    -    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    +    _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
         if ( sobj ) 
    -      return SMESH::GetActiveStudyDocument()->GetUseCaseBuilder()->HasChildren( sobj );
    +      return SMESH::getStudy()->GetUseCaseBuilder()->HasChildren( sobj );
       }
       return false;
     }
    @@ -663,9 +661,10 @@ int SMESHGUI_Selection::nbChildren( int ind ) const
       int nb = 0;
       if ( ind >= 0 )
       {
    -    _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
    -    if ( sobj && sobj->GetStudy()->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) {
    -      _PTR(UseCaseIterator) it = sobj->GetStudy()->GetUseCaseBuilder()->GetUseCaseIterator( sobj ); 
    +    _PTR(Study) study = SMESH::getStudy();
    +    _PTR(SObject) sobj = study->FindObjectID( entry( ind ).toLatin1().data() );
    +    if ( sobj && study->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) {
    +      _PTR(UseCaseIterator) it = study->GetUseCaseBuilder()->GetUseCaseIterator( sobj );
           for ( it->Init( false ); it->More(); it->Next() ) nb++;
         }
       }
    @@ -687,10 +686,10 @@ bool SMESHGUI_Selection::isContainer( int ind ) const
     //purpose  : 
     //=======================================================================
     
    -int SMESHGUI_Selection::type( const QString& entry, _PTR(Study) study )
    +int SMESHGUI_Selection::type( const QString& entry )
     {
       int res = -1;
    -  _PTR(SObject) obj = study->FindObjectID( entry.toLatin1().data() );
    +  _PTR(SObject) obj = SalomeApp_Application::getStudy()->FindObjectID( entry.toLatin1().data() );
       if ( obj ) {
         _PTR(SObject) ref;
         if ( obj->ReferencedObject( ref ) )
    @@ -786,7 +785,7 @@ QString SMESHGUI_Selection::typeName( const int t )
     bool SMESHGUI_Selection::isImported( const int ind ) const
     {
       bool res = false;
    -  _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().constData() );
    +  _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() );
       if ( sobj )
       {
         SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( sobj ) );
    @@ -816,7 +815,7 @@ int SMESHGUI_Selection::guiState()
     
     QString SMESHGUI_Selection::groupType( int ind ) const
     {
    -  _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().constData() );
    +  _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() );
       if ( sobj )
       {
         SMESH::SMESH_Group_var g = SMESH::SObjectToInterface( sobj );
    diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h
    index 71690c713..115b0e46f 100644
    --- a/src/SMESHGUI/SMESHGUI_Selection.h
    +++ b/src/SMESHGUI/SMESHGUI_Selection.h
    @@ -85,7 +85,7 @@ public:
       
       SMESH_Actor*            getActor( int ) const;
     
    -  static int              type( const QString&, _PTR(Study) );
    +  static int              type( const QString& );
       static QString          typeName( const int );
       static  int             guiState();
       
    diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx
    index ca551105a..ed560b87e 100644
    --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx
    +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx
    @@ -295,36 +295,28 @@ SVTK_Selector* SMESHGUI_SelectionOp::selector() const
     //=======================================================================
     int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype ) const
     {
    -  SalomeApp_Study* _study = dynamic_cast( study() );
    -  if( !_study )
    -    return -1;
    -
    -  _PTR( Study ) st = _study->studyDS();
    +  _PTR(Study) aStudy = SMESH::getStudy();
     
       int res = -1;
       if( objtype == Object )
       {
    -    SalomeApp_Study* _study = dynamic_cast( study() );
    -    if( _study )
    +    int t = SMESHGUI_Selection::type( str );
    +    if( t<0 )
         {
    -      int t = SMESHGUI_Selection::type( str, _study->studyDS() );
    -      if( t<0 )
    +      //try to get GEOM type
    +      _PTR( SObject ) sobj = aStudy->FindObjectID( str.toLatin1().data() );
    +      if( sobj )
           {
    -        //try to get GEOM type
    -        _PTR( SObject ) sobj = st->FindObjectID( str.toLatin1().data() );
    -        if( sobj )
    -        {
    -          GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
    -            dynamic_cast( sobj.get() )->GetObject() );
    -          if( !CORBA::is_nil( obj ) )
    -            // as decoding of type id is not realized in LightApp_Dialog,
    -            //make all GEOM objects have same type id
    -            res = SMESHGUI_Dialog::prefix( "GEOM" );// + obj->GetType();
    -        }
    +        GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
    +          dynamic_cast( sobj.get() )->GetObject() );
    +        if( !CORBA::is_nil( obj ) )
    +          // as decoding of type id is not realized in LightApp_Dialog,
    +          //make all GEOM objects have same type id
    +          res = SMESHGUI_Dialog::prefix( "GEOM" );// + obj->GetType();
           }
    -      else
    -        res = SMESHGUI_Dialog::prefix( "SMESH" ) + t;
         }
    +    else
    +      res = SMESHGUI_Dialog::prefix( "SMESH" ) + t;
       }
       else
       {
    @@ -335,7 +327,7 @@ int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype
         int id = _id.toInt( &ok );
         if( ok )
         {
    -      _PTR( SObject ) sobj = st->FindObjectID( entry.toLatin1().data() );
    +      _PTR( SObject ) sobj = aStudy->FindObjectID( entry.toLatin1().data() );
           SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( 
             dynamic_cast( sobj.get() )->GetObject() );
           SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow( 
    @@ -422,13 +414,9 @@ void SMESHGUI_SelectionOp::selected( QStringList& names,
           QString id = anIt.Value()->getEntry();
           ids.append( id );
           types.append( typeById( id, Object ) );
    -      SalomeApp_Study* _study = dynamic_cast( study() );
    -      if( _study )
    -      {
    -        _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() );
    -        if( obj )
    -          names.append( QString( obj->GetName().c_str() ).trimmed() );
    -      }
    +      _PTR(SObject) obj = SMESH::getStudy()->FindObjectID( anIt.Value()->getEntry() );
    +      if( obj )
    +        names.append( QString( obj->GetName().c_str() ).trimmed() );
         }
       }
     }
    diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
    index 22253c4d6..27dfe06e7 100644
    --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
    @@ -1293,7 +1293,7 @@ void SMESHGUI_SewingDlg::onSwapClicked()
     //=================================================================================
     bool SMESHGUI_SewingDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       bool aResult = false;
    diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx
    index 6bff0c7ec..5d82de8be 100644
    --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx
    @@ -319,13 +319,12 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
         else
         {
           GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
    -      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
     
    -      if (geomGen->_is_nil() || !aStudy)
    +      if (geomGen->_is_nil())
             return;
     
           GEOM::GEOM_IShapesOperations_wrap aShapesOp =
    -        geomGen->GetIShapesOperations(aStudy->StudyId());
    +        geomGen->GetIShapesOperations();
           if (aShapesOp->_is_nil() )
             return;
     
    @@ -364,7 +363,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
           else if (aNumberOfGO > 1)
           {
             GEOM::GEOM_IGroupOperations_wrap aGroupOp =
    -          geomGen->GetIGroupOperations(aStudy->StudyId());
    +          geomGen->GetIGroupOperations();
             if(aGroupOp->_is_nil())
               return;
     
    @@ -386,9 +385,8 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
     
           // publish the GEOM object in study
           QString aNewGeomGroupName ( myDlg->myGeomName->text() );
    -      SALOMEDS::Study_var aStudyVar = _CAST(Study,aStudy)->GetStudy();
           SALOMEDS::SObject_wrap aNewGroupSO =
    -        geomGen->AddInStudy( aStudyVar, aGeomObject, 
    +        geomGen->AddInStudy( aGeomObject,
                                  aNewGeomGroupName.toLatin1().data(), aMeshShape);
     
           // get a GEOM_Object already published, which doesn't need UnRegister()
    diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
    index 08424f6d4..a95ce5648 100755
    --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
    @@ -493,7 +493,7 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
     //=================================================================================
     bool SMESHGUI_SingleEditDlg::onApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
       // verify validity of input data
       if (!isValid(true))
    diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
    index caa4c5119..3f79c3292 100644
    --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
    @@ -341,7 +341,7 @@ void SMESHGUI_SmoothingDlg::Init()
     //=================================================================================
     bool SMESHGUI_SmoothingDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if (!isValid())
    diff --git a/src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx b/src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx
    index 71cca13a5..75e03affb 100644
    --- a/src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx
    +++ b/src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx
    @@ -202,7 +202,7 @@ bool SMESHGUI_SplitBiQuadOp::onApply()
       int nbObj = 0;
       for ( int i = 0; i < entries.count() ; ++i )
       {
    -    _PTR(SObject) pObj = studyDS()->FindObjectID( entries[i].toLatin1().data() );
    +    _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().data() );
         SMESH::SMESH_IDSource_var obj = SMESH::SObjectToInterface( pObj );
         if( !CORBA::is_nil( obj ))
         {
    diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
    index e6886021a..f994189fd 100644
    --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
    @@ -474,7 +474,7 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId)
     //=================================================================================
     bool SMESHGUI_SymmetryDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if( !isValid() )
    diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
    index 75e5635bf..21342aebd 100644
    --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
    +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
    @@ -475,7 +475,7 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId)
     //=================================================================================
     bool SMESHGUI_TranslationDlg::ClickOnApply()
     {
    -  if (mySMESHGUI->isActiveStudyLocked())
    +  if (SMESHGUI::isStudyLocked())
         return false;
     
       if( !isValid() )
    diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx
    index 21f74593f..e6fdb1c15 100644
    --- a/src/SMESHGUI/SMESHGUI_Utils.cxx
    +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx
    @@ -76,12 +76,6 @@ namespace SMESH
         return SUIT_Session::session()->resourceMgr();
       }
     
    -  _PTR(Study)
    -  GetCStudy(const SalomeApp_Study* theStudy)
    -  {
    -    return theStudy->studyDS();
    -  }
    -
       CORBA::Object_var 
       DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner)
       {
    @@ -90,9 +84,8 @@ namespace SMESH
           const Handle(SALOME_InteractiveObject)& anIO = theOwner->IO();
           if(!anIO.IsNull()){
             if(anIO->hasEntry()){
    -          _PTR(Study) aStudy = GetActiveStudyDocument();
    -          _PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
    -          anObj = SObjectToObject(aSObj,aStudy);
    +          _PTR(SObject) aSObj = getStudy()->FindObjectID(anIO->getEntry());
    +          anObj = SObjectToObject(aSObj);
             }
           }
         }
    @@ -118,13 +111,12 @@ namespace SMESH
           return NULL;
       }
     
    -  _PTR(Study) GetActiveStudyDocument()
    +  _PTR(Study) getStudy()
       {
    -    SalomeApp_Study* aStudy = dynamic_cast(GetActiveStudy());
    -    if (aStudy)
    -      return aStudy->studyDS();
    -    else
    -      return _PTR(Study)();
    +    static _PTR(Study) _study;
    +    if(!_study)
    +      _study = SalomeApp_Application::getStudy();
    +    return _study;
       }
     
       _PTR(SObject) FindSObject (CORBA::Object_ptr theObject)
    @@ -132,26 +124,23 @@ namespace SMESH
         SalomeApp_Application* app = dynamic_cast
           (SUIT_Session::session()->activeApplication());
         if (app && !CORBA::is_nil(theObject)) {
    -      if(_PTR(Study) aStudy = GetActiveStudyDocument()){
    -        CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
    -        if (strcmp(anIOR.in(), "") != 0)
    -          return aStudy->FindObjectIOR(anIOR.in());
    -      }
    +      CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
    +      if (strcmp(anIOR.in(), "") != 0)
    +        return getStudy()->FindObjectIOR(anIOR.in());
         }
         return _PTR(SObject)();
       }
     
       void SetName (_PTR(SObject) theSObject, const QString& theName)
       {
    -    _PTR(Study) aStudy = GetActiveStudyDocument();
    -    if (aStudy->GetProperties()->IsLocked())
    +    if (getStudy()->GetProperties()->IsLocked())
           return;
         SMESHGUI::GetSMESHGen()->SetName(theSObject->GetIOR().c_str(), theName.toLatin1().data());
       }
     
       void SetValue (_PTR(SObject) theSObject, const QString& theValue)
       {
    -    _PTR(Study) aStudy = GetActiveStudyDocument();
    +    _PTR(Study) aStudy = getStudy();
         if (aStudy->GetProperties()->IsLocked())
           return;
         _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
    @@ -164,7 +153,7 @@ namespace SMESH
       
       void setFileName (_PTR(SObject) theSObject, const QString& theValue)
       {
    -    _PTR(Study) aStudy = GetActiveStudyDocument();
    +    _PTR(Study) aStudy = getStudy();
         if (aStudy->GetProperties()->IsLocked())
           return;
         _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
    @@ -177,7 +166,7 @@ namespace SMESH
       
       void setFileType (_PTR(SObject) theSObject, const QString& theValue)
       {
    -    _PTR(Study) aStudy = GetActiveStudyDocument();
    +    _PTR(Study) aStudy = getStudy();
         if (aStudy->GetProperties()->IsLocked())
           return;
         _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
    @@ -188,8 +177,7 @@ namespace SMESH
           aFileType->SetValue(theValue.toLatin1().data());
       }
     
    -  CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
    -                                     _PTR(Study)   /*theStudy*/)
    +  CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject )
       {
         SalomeApp_Application* app = dynamic_cast
           (SUIT_Session::session()->activeApplication());
    @@ -207,12 +195,6 @@ namespace SMESH
         return CORBA::Object::_nil();
       }
     
    -  CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject)
    -  {
    -    _PTR(Study) aStudy;// = GetActiveStudyDocument(); -- aStudy is not used
    -    return SObjectToObject(theSObject,aStudy);
    -  }
    -
       _PTR(SObject) ObjectToSObject( CORBA::Object_ptr theObject )
       {
         _PTR(SObject) res;
    @@ -220,9 +202,8 @@ namespace SMESH
           (SUIT_Session::session()->activeApplication());
         if ( app ) {
           CORBA::String_var ior = app->orb()->object_to_string( theObject );
    -      SalomeApp_Study* study = dynamic_cast( app->activeStudy() );
    -      if ( study && strlen( ior ) > 0 )
    -        res = study->studyDS()->FindObjectIOR( ior.in() );
    +      if ( strlen( ior ) > 0 )
    +        res = getStudy()->FindObjectIOR( ior.in() );
         }
         return res;
       }
    @@ -231,9 +212,8 @@ namespace SMESH
       {
         if (!theIO.IsNull()) {
           if (theIO->hasEntry()) {
    -        _PTR(Study) aStudy = GetActiveStudyDocument();
    -        _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
    -        return SObjectToObject(anObj,aStudy);
    +        _PTR(SObject) anObj = getStudy()->FindObjectID(theIO->getEntry());
    +        return SObjectToObject(anObj);
           }
         }
         return CORBA::Object::_nil();
    @@ -279,8 +259,8 @@ namespace SMESH
     
       void ModifiedMesh (_PTR(SObject) theSObject, bool theIsNotModif, bool isEmptyMesh)
       {
    -    _PTR(Study) aStudy = GetActiveStudyDocument();
    -    if ( !aStudy || aStudy->GetProperties()->IsLocked() )
    +    _PTR(Study) aStudy = getStudy();
    +    if ( !aStudy || aStudy->GetProperties()->IsLocked())
           return;
     
         _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
    @@ -314,7 +294,7 @@ namespace SMESH
               aPixmap = anAttr;
     
               std::string entry = aSObj1->GetID();
    -          int objType = SMESHGUI_Selection::type( entry.c_str(), aStudy );
    +          int objType = SMESHGUI_Selection::type( entry.c_str() );
               if ( objType == SMESH::HYPOTHESIS || objType == SMESH::ALGORITHM )
                 continue;
     
    diff --git a/src/SMESHGUI/SMESHGUI_Utils.h b/src/SMESHGUI/SMESHGUI_Utils.h
    index 5b2e0b89b..4a1a1c600 100644
    --- a/src/SMESHGUI/SMESHGUI_Utils.h
    +++ b/src/SMESHGUI/SMESHGUI_Utils.h
    @@ -80,10 +80,6 @@ SMESHGUI_EXPORT
     SMESHGUI_EXPORT
       SUIT_ResourceMgr*
       GetResourceMgr( const SalomeApp_Module* );
    -  
    -SMESHGUI_EXPORT
    -  _PTR(Study)
    -  GetCStudy( const SalomeApp_Study* );
     
     SMESHGUI_EXPORT
       CORBA::Object_var DataOwnerToObject( const LightApp_DataOwnerPtr& );
    @@ -104,7 +100,7 @@ SMESHGUI_EXPORT
       SUIT_ViewWindow* GetActiveWindow();
     
     SMESHGUI_EXPORT
    -  _PTR(Study) GetActiveStudyDocument();
    +  _PTR(Study) getStudy();
     
     SMESHGUI_EXPORT
       _PTR(SObject) FindSObject( CORBA::Object_ptr );
    @@ -117,10 +113,6 @@ SMESHGUI_EXPORT
       void setFileType( _PTR(SObject), const QString& );
       void setFileName( _PTR(SObject), const QString& );
     
    -SMESHGUI_EXPORT
    -  CORBA::Object_var SObjectToObject( _PTR(SObject),
    -                                     _PTR(Study) );
    -
     SMESHGUI_EXPORT
       CORBA::Object_var SObjectToObject( _PTR(SObject) );
     
    diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx
    index 5c5bbab52..98fcb550d 100644
    --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx
    +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx
    @@ -76,7 +76,7 @@
     
     namespace SMESH
     {
    -  typedef std::map TVisualObjCont;
    +  typedef std::map TVisualObjCont;
       static TVisualObjCont VISUAL_OBJ_CONT;
     
       //=============================================================================
    @@ -136,17 +136,13 @@ namespace SMESH
           }
         }
         
    -    if (aViewManager ) {
    -      int aStudyId = aViewManager->study()->id();
    -      TVisualObjCont::key_type aKey(aStudyId,theEntry);
    -      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
    -      if(anIter != VISUAL_OBJ_CONT.end()) {
    -        // for unknown reason, object destructor is not called, so clear object manually
    -        anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
    -        anIter->second->GetUnstructuredGrid()->SetPoints(0);
    -      }
    -      VISUAL_OBJ_CONT.erase(aKey);
    +    TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(theEntry);
    +    if(anIter != VISUAL_OBJ_CONT.end()) {
    +      // for unknown reason, object destructor is not called, so clear object manually
    +      anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
    +      anIter->second->GetUnstructuredGrid()->SetPoints(0);
         }
    +    VISUAL_OBJ_CONT.erase(theEntry);
     
         if(actorRemoved)
           aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
    @@ -199,7 +195,7 @@ namespace SMESH
        */
       //================================================================================
     
    -  void RemoveVisuData(int studyID)
    +  void RemoveVisuData()
       {
         SalomeApp_Application* app = dynamic_cast
           ( SUIT_Session::session()->activeApplication() );
    @@ -207,8 +203,7 @@ namespace SMESH
         ViewManagerList viewMgrs = app->viewManagers();
         for ( int iM = 0; iM < viewMgrs.count(); ++iM ) {
           SUIT_ViewManager* aViewManager = viewMgrs.at( iM );
    -      if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() &&
    -           aViewManager->study()->id() == studyID ) {
    +      if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() ) {
             QVector views = aViewManager->getViews();
             for ( int iV = 0; iV < views.count(); ++iV ) {
               if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
    @@ -229,16 +224,10 @@ namespace SMESH
         }
         TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.begin();
         for ( ; anIter != VISUAL_OBJ_CONT.end(); ) {
    -      int curId = anIter->first.first;
    -      if ( curId == studyID ) {
    -        // for unknown reason, object destructor is not called, so clear object manually
    -        anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
    -        anIter->second->GetUnstructuredGrid()->SetPoints(0);
    -        VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
    -      }
    -      else {
    -        anIter++;
    -      }
    +      // for unknown reason, object destructor is not called, so clear object manually
    +      anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
    +      anIter->second->GetUnstructuredGrid()->SetPoints(0);
    +      VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
         }
       }
     
    @@ -278,18 +267,17 @@ namespace SMESH
        */
       //================================================================================
     
    -  TVisualObjPtr GetVisualObj(int theStudyId, const char* theEntry, bool nulData){
    +  TVisualObjPtr GetVisualObj(const char* theEntry, bool nulData){
         TVisualObjPtr aVisualObj;
    -    TVisualObjCont::key_type aKey(theStudyId,theEntry);
         try{
           OCC_CATCH_SIGNALS;
    -      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
    +      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(theEntry);
           if(anIter != VISUAL_OBJ_CONT.end()){
             aVisualObj = anIter->second;
           }else{
             SalomeApp_Application* app =
               dynamic_cast( SMESHGUI::activeStudy()->application() );
    -        _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
    +        _PTR(Study) aStudy = SMESH::getStudy();
             _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
             if(aSObj){
               _PTR(GenericAttribute) anAttr;
    @@ -302,7 +290,7 @@ namespace SMESH
                   SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
                   if(!aMesh->_is_nil()){
                     aVisualObj.reset(new SMESH_MeshObj(aMesh));
    -                TVisualObjCont::value_type aValue(aKey,aVisualObj);
    +                TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                     VISUAL_OBJ_CONT.insert(aValue);
                   }
                   //Try narrow to SMESH_Group interface
    @@ -313,10 +301,10 @@ namespace SMESH
                     aFatherSObj = aFatherSObj->GetFather();
                     if(!aFatherSObj) return aVisualObj;
                     CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
    -                TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
    +                TVisualObjPtr aVisObj = GetVisualObj(anEntry.in());
                     if(SMESH_MeshObj* aMeshObj = dynamic_cast(aVisObj.get())){
                       aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
    -                  TVisualObjCont::value_type aValue(aKey,aVisualObj);
    +                  TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                       VISUAL_OBJ_CONT.insert(aValue);
                     }
                   }
    @@ -328,10 +316,10 @@ namespace SMESH
                     aFatherSObj = aFatherSObj->GetFather();
                     if(!aFatherSObj) return aVisualObj;
                     CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
    -                TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
    +                TVisualObjPtr aVisObj = GetVisualObj(anEntry.in());
                     if(SMESH_MeshObj* aMeshObj = dynamic_cast(aVisObj.get())){
                       aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
    -                  TVisualObjCont::value_type aValue(aKey,aVisualObj);
    +                  TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                       VISUAL_OBJ_CONT.insert(aValue);
                     }
                   }
    @@ -553,7 +541,7 @@ namespace SMESH
           return NULL;
     
         if(!CORBA::is_nil(theObject)){
    -      _PTR(Study) aStudy = GetActiveStudyDocument();
    +      _PTR(Study) aStudy = getStudy();
           CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
           _PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
           if(aSObject){
    @@ -565,14 +553,12 @@ namespace SMESH
       }
     
     
    -  SMESH_Actor* CreateActor(_PTR(Study) theStudy,
    -                           const char* theEntry,
    +  SMESH_Actor* CreateActor(const char* theEntry,
                                int theIsClear)
       {
         SMESH_Actor *anActor = NULL;
    -    CORBA::Long anId = theStudy->StudyId();
    -    if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
    -      _PTR(SObject) aSObj = theStudy->FindObjectID(theEntry);
    +    if(TVisualObjPtr aVisualObj = GetVisualObj(theEntry)){
    +      _PTR(SObject) aSObj = getStudy()->FindObjectID(theEntry);
           if(aSObj){
             _PTR(GenericAttribute) anAttr;
             if(aSObj->FindAttribute(anAttr,"AttributeName")){
    @@ -645,10 +631,7 @@ namespace SMESH
             Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
             if(anIO->hasEntry()){
               std::string anEntry = anIO->getEntry();
    -          SalomeApp_Study* aStudy = dynamic_cast( vtkWnd->getViewManager()->study() );
    -          int aStudyId = aStudy->id();
    -          TVisualObjCont::key_type aKey(aStudyId,anEntry);
    -          VISUAL_OBJ_CONT.erase(aKey);
    +          VISUAL_OBJ_CONT.erase(anEntry);
             }
           }
           theActor->Delete();
    @@ -753,13 +736,10 @@ namespace SMESH
                 {
                   //MESSAGE("---");
                   SalomeApp_Study* aStudy = dynamic_cast(theWnd->getViewManager()->study());
    -              _PTR(Study) aDocument = aStudy->studyDS();
    -              // Pass non-visual objects (hypotheses, etc.), return true in this case
    -              CORBA::Long anId = aDocument->StudyId();
                   TVisualObjPtr aVisualObj;
    -              if ( (aVisualObj = GetVisualObj(anId,theEntry)) && aVisualObj->IsValid())
    +              if ( (aVisualObj = GetVisualObj(theEntry)) && aVisualObj->IsValid())
                   {
    -                if ((anActor = CreateActor(aDocument,theEntry,true))) {
    +                if ((anActor = CreateActor(theEntry,true))) {
                       bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
                       DisplayActor(theWnd,anActor);
                       anActor->SetVisibility(true);
    @@ -827,9 +807,7 @@ namespace SMESH
       bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
       {
         //MESSAGE("Update");
    -    _PTR(Study) aStudy = GetActiveStudyDocument();
    -    CORBA::Long anId = aStudy->StudyId();
    -    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
    +    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(theIO->getEntry())) {
           if ( theDisplay )
             UpdateView(SMESH::eDisplay,theIO->getEntry());
           return true;
    @@ -840,9 +818,7 @@ namespace SMESH
       bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
       {
         //MESSAGE("UpdateNulData");
    -    _PTR(Study) aStudy = GetActiveStudyDocument();
    -    CORBA::Long anId = aStudy->StudyId();
    -    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
    +    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(theIO->getEntry(), true)) {
           if ( theDisplay )
             UpdateView(SMESH::eDisplay,theIO->getEntry());
           return true;
    diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.h b/src/SMESHGUI/SMESHGUI_VTKUtils.h
    index b1159bd13..217b1995d 100644
    --- a/src/SMESHGUI/SMESHGUI_VTKUtils.h
    +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.h
    @@ -63,10 +63,9 @@ class vtkActor;
     namespace SMESH
     {
       //----------------------------------------------------------------------------
    -  typedef std::pair TKeyOfVisualObj;
       
     SMESHGUI_EXPORT
    -  TVisualObjPtr GetVisualObj( int, const char*, bool nulData =false );
    +  TVisualObjPtr GetVisualObj( const char*, bool nulData =false );
     SMESHGUI_EXPORT
       void OnVisuException(); // PAL16631
     
    @@ -103,13 +102,13 @@ SMESHGUI_EXPORT
     
       //----------------------------------------------------------------------------
     SMESHGUI_EXPORT  
    -  SMESH_Actor* CreateActor( _PTR(Study), const char*, int = false );
    +  SMESH_Actor* CreateActor( const char*, int = false );
     SMESHGUI_EXPORT
       void DisplayActor( SUIT_ViewWindow*, SMESH_Actor* );
     SMESHGUI_EXPORT
       void RemoveActor( SUIT_ViewWindow*, SMESH_Actor* );
     SMESHGUI_EXPORT
    -  void RemoveVisuData( int );
    +  void RemoveVisuData();
     
       //----------------------------------------------------------------------------
       enum EDisplaing { eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll };
    diff --git a/src/SMESHUtils/SMESH_MAT2d.cxx b/src/SMESHUtils/SMESH_MAT2d.cxx
    index aad6899d3..f37334a16 100644
    --- a/src/SMESHUtils/SMESH_MAT2d.cxx
    +++ b/src/SMESHUtils/SMESH_MAT2d.cxx
    @@ -434,7 +434,7 @@ namespace
         text << "import salome, SMESH\n";
         text << "salome.salome_init()\n";
         text << "from salome.smesh import smeshBuilder\n";
    -    text << "smesh = smeshBuilder.New(salome.myStudy)\n";
    +    text << "smesh = smeshBuilder.New()\n";
         text << "m=smesh.Mesh()\n";
         for ( size_t iE = 0; iE < bndSegsPerEdge.size(); ++iE )
         {
    diff --git a/src/SMESH_I/CMakeLists.txt b/src/SMESH_I/CMakeLists.txt
    index f8fabc08c..63c599a88 100644
    --- a/src/SMESH_I/CMakeLists.txt
    +++ b/src/SMESH_I/CMakeLists.txt
    @@ -70,6 +70,7 @@ SET(_link_LIBRARIES
       ${KERNEL_SalomeGenericObj}
       ${KERNEL_SalomeIDLKERNEL}
       ${KERNEL_SALOMELocalTrace}
    +  ${KERNEL_SalomeKernelHelpers}
       ${CAS_TKCDF}
       ${CAS_TKBO}
       ${CAS_TKShHealing}
    diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx
    index f3a0a556c..7b957b6a3 100644
    --- a/src/SMESH_I/SMESH_2smeshpy.cxx
    +++ b/src/SMESH_I/SMESH_2smeshpy.cxx
    @@ -461,7 +461,6 @@ SMESH_2smeshpy::ConvertScript(std::list< TCollection_AsciiString >&     theScrip
                                   Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
                                   Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                                   std::set< TCollection_AsciiString >&      theRemovedObjIDs,
    -                              SALOMEDS::Study_ptr&                      theStudy,
                                   const bool                                theToKeepAllCommands)
     {
       std::list< TCollection_AsciiString >::iterator lineIt;
    @@ -484,7 +483,6 @@ SMESH_2smeshpy::ConvertScript(std::list< TCollection_AsciiString >&     theScrip
       theGen = new _pyGen( theEntry2AccessorMethod,
                            theObjectNames,
                            theRemovedObjIDs,
    -                       theStudy,
                            theToKeepAllCommands );
     
       for ( lineIt = theScriptLines.begin(); lineIt != theScriptLines.end(); ++lineIt )
    @@ -516,7 +514,6 @@ SMESH_2smeshpy::ConvertScript(std::list< TCollection_AsciiString >&     theScrip
       set<_pyID> createdObjects;
       createdObjects.insert( "smeshBuilder" );
       createdObjects.insert( "smesh" );
    -  createdObjects.insert( "theStudy" );
       for ( cmd = theGen->GetCommands().begin(); cmd != theGen->GetCommands().end(); ++cmd )
       {
     #ifdef DUMP_CONVERSION
    @@ -544,7 +541,6 @@ SMESH_2smeshpy::ConvertScript(std::list< TCollection_AsciiString >&     theScrip
     _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
                    Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                    std::set< TCollection_AsciiString >&      theRemovedObjIDs,
    -               SALOMEDS::Study_ptr&                      theStudy,
                    const bool                                theToKeepAllCommands)
       : _pyObject( new _pyCommand( "", 0 )),
         myNbCommands( 0 ),
    @@ -553,7 +549,6 @@ _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod
         myRemovedObjIDs( theRemovedObjIDs ),
         myNbFilters( 0 ),
         myToKeepAllCommands( theToKeepAllCommands ),
    -    myStudy( SALOMEDS::Study::_duplicate( theStudy )),
         myGeomIDNb(0), myGeomIDIndex(-1)
     {
       // make that GetID() to return TPythonDump::SMESHGenName()
    @@ -562,11 +557,11 @@ _pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod
       GetCreationCmd()->GetString() += "=";
     
       // Find 1st digit of study entry by which a GEOM object differs from a SMESH object
    -  if ( !theObjectNames.IsEmpty() && !CORBA::is_nil( theStudy ))
    +  if ( !theObjectNames.IsEmpty() )
       {
         // find a GEOM entry
         _pyID geomID;
    -    SALOMEDS::SComponent_wrap geomComp = theStudy->FindComponent("GEOM");
    +    SALOMEDS::SComponent_wrap geomComp = SMESH_Gen_i::getStudyServant()->FindComponent("GEOM");
         if ( geomComp->_is_nil() ) return;
         CORBA::String_var entry = geomComp->GetID();
         geomID = entry.in();
    @@ -1101,7 +1096,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
       static TStringSet smeshpyMethods;
       if ( smeshpyMethods.empty() ) {
         const char * names[] =
    -      { "SetEmbeddedMode","IsEmbeddedMode","SetCurrentStudy","GetCurrentStudy",
    +      { "SetEmbeddedMode","IsEmbeddedMode","UpdateStudy","GetStudy",
             "GetPattern","GetSubShapesId",
             "" }; // <- mark of array end
         smeshpyMethods.Insert( names );
    @@ -1673,7 +1668,7 @@ bool _pyGen::IsNotPublished(const _pyID& theObjID) const
       // either the SMESH object is not in study or it is a GEOM object
       if ( IsGeomObject( theObjID ))
       {
    -    SALOMEDS::SObject_wrap so = myStudy->FindObjectID( theObjID.ToCString() );
    +    SALOMEDS::SObject_wrap so = SMESH_Gen_i::getStudyServant()->FindObjectID( theObjID.ToCString() );
         if ( so->_is_nil() ) return true;
         CORBA::Object_var obj = so->GetObject();
         return CORBA::is_nil( obj );
    @@ -2122,7 +2117,7 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand )
         const char * names[] =
           { "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents",
             "GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId",
    -        "ClearLog","GetStudyId","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
    +        "ClearLog","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
             "NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles",
             "NbTrianglesOfOrder","NbQuadrangles","NbQuadranglesOfOrder","NbPolygons","NbVolumes",
             "NbVolumesOfOrder","NbTetras","NbTetrasOfOrder","NbHexas","NbHexasOfOrder",
    diff --git a/src/SMESH_I/SMESH_2smeshpy.hxx b/src/SMESH_I/SMESH_2smeshpy.hxx
    index 6fd991533..589c78317 100644
    --- a/src/SMESH_I/SMESH_2smeshpy.hxx
    +++ b/src/SMESH_I/SMESH_2smeshpy.hxx
    @@ -255,7 +255,6 @@ public:
       _pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
              Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
              std::set< TCollection_AsciiString >&      theRemovedObjIDs,
    -         SALOMEDS::Study_ptr&                      theStudy,
              const bool                                theToKeepAllCommands);
       Handle(_pyCommand) AddCommand( const _AString& theCommand );
       void ExchangeCommands( Handle(_pyCommand) theCmd1, Handle(_pyCommand) theCmd2 );
    @@ -326,7 +325,6 @@ private:
       Handle(_pyCommand)                        myLastCommand;
       int                                       myNbFilters;
       bool                                      myToKeepAllCommands;
    -  SALOMEDS::Study_var                       myStudy;
       int                                       myGeomIDNb, myGeomIDIndex;
       std::map< _AString, ExportedMeshData >    myFile2ExportedMesh;
       Handle( _pyHypothesisReader )             myHypReader;
    diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx
    index cc842f215..92506466c 100644
    --- a/src/SMESH_I/SMESH_DumpPython.cxx
    +++ b/src/SMESH_I/SMESH_DumpPython.cxx
    @@ -74,13 +74,12 @@ namespace SMESH
           SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
           std::string aString = myStream.str();
           TCollection_AsciiString aCollection(Standard_CString(aString.c_str()));
    -      SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
    -      if(!aStudy->_is_nil() && !aCollection.IsEmpty())
    +      if(!aCollection.IsEmpty())
           {
             const std::string & objEntry = SMESH_Gen_i::GetSMESHGen()->GetLastObjEntry();
             if ( !objEntry.empty() )
               aCollection += (TVar::ObjPrefix() + objEntry ).c_str();
    -        aSMESHGen->AddToPythonScript(aStudy->StudyId(),aCollection);
    +        aSMESHGen->AddToPythonScript(aCollection);
             if(MYDEBUG) MESSAGE(aString);
             // prevent misuse of already treated variables
             aSMESHGen->UpdateParameters(CORBA::Object_var().in(),"");
    @@ -316,8 +315,7 @@ namespace SMESH
       operator<<(CORBA::Object_ptr theArg)
       {
         SMESH_Gen_i*          aSMESHGen = SMESH_Gen_i::GetSMESHGen();
    -    SALOMEDS::Study_var      aStudy = aSMESHGen->GetCurrentStudy();
    -    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
    +    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
         if(!aSObject->_is_nil()) {
           CORBA::String_var id = aSObject->GetID();
           myStream << id;
    @@ -336,8 +334,7 @@ namespace SMESH
       TPythonDump::
       operator<<(SMESH::SMESH_Hypothesis_ptr theArg)
       {
    -    SALOMEDS::Study_var     aStudy = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
    -    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
    +    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
         if(aSObject->_is_nil() && !CORBA::is_nil(theArg))
           myStream << "hyp_" << theArg->GetId();
         else
    @@ -352,8 +349,7 @@ namespace SMESH
         if ( CORBA::is_nil( theArg ) )
           return *this << "None";
         SMESH_Gen_i*          aSMESHGen = SMESH_Gen_i::GetSMESHGen();
    -    SALOMEDS::Study_var      aStudy = aSMESHGen->GetCurrentStudy();
    -    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
    +    SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
         if(!aSObject->_is_nil())
         {
           return *this << aSObject;
    @@ -368,7 +364,7 @@ namespace SMESH
           SMESH::long_array_var    anElementsId = theArg->GetIDs();
           SMESH::array_of_ElementType_var types = theArg->GetTypes();
           SMESH::ElementType               type = types->length() ? types[0] : SMESH::ALL;
    -      SALOMEDS::SObject_wrap         meshSO = SMESH_Gen_i::ObjectToSObject(aStudy,mesh);
    +      SALOMEDS::SObject_wrap         meshSO = SMESH_Gen_i::ObjectToSObject(mesh);
           if ( meshSO->_is_nil() ) // don't waste memory for dumping not published objects
             return *this << mesh << ".GetIDSource([], " << type << ")";
           else
    @@ -718,12 +714,11 @@ void RemoveTabulation( TCollection_AsciiString& theScript )
     //function : DumpPython
     //purpose  :
     //=======================================================================
    -Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Object_ptr theStudy,
    -                                           CORBA::Boolean isPublished,
    +Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Boolean isPublished,
                                                CORBA::Boolean isMultiFile,
                                                CORBA::Boolean& isValidScript)
     {
    -  SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
    +  SALOMEDS::Study_var aStudy = getStudyServant();
       if (CORBA::is_nil(aStudy))
         return new Engines::TMPFile(0);
     
    @@ -761,7 +756,7 @@ Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Object_ptr theStudy,
     
       // Add trace of API methods calls and replace study entries by names
       TCollection_AsciiString aScript;
    -  aScript += DumpPython_impl(aStudy, aMap, aMapNames, isPublished, isMultiFile,
    +  aScript += DumpPython_impl(aMap, aMapNames, isPublished, isMultiFile,
                                  myIsHistoricalPythonDump, isValidScript, aSavedTrace);
     
       int aLen = aScript.Length();
    @@ -782,12 +777,12 @@ Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Object_ptr theStudy,
      *  AddToPythonScript
      */
     //=============================================================================
    -void SMESH_Gen_i::AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString)
    +void SMESH_Gen_i::AddToPythonScript (const TCollection_AsciiString& theString)
     {
    -  if (myPythonScripts.find(theStudyID) == myPythonScripts.end()) {
    -    myPythonScripts[theStudyID] = new TColStd_HSequenceOfAsciiString;
    +  if (myPythonScript.IsNull()) {
    +    myPythonScript = new TColStd_HSequenceOfAsciiString;
       }
    -  myPythonScripts[theStudyID]->Append(theString);
    +  myPythonScript->Append(theString);
     }
     
     //=============================================================================
    @@ -795,11 +790,11 @@ void SMESH_Gen_i::AddToPythonScript (int theStudyID, const TCollection_AsciiStri
      *  RemoveLastFromPythonScript
      */
     //=============================================================================
    -void SMESH_Gen_i::RemoveLastFromPythonScript (int theStudyID)
    +void SMESH_Gen_i::RemoveLastFromPythonScript()
     {
    -  if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
    -    int aLen = myPythonScripts[theStudyID]->Length();
    -    myPythonScripts[theStudyID]->Remove(aLen);
    +  if (!myPythonScript.IsNull()) {
    +    int aLen = myPythonScript->Length();
    +    myPythonScript->Remove(aLen);
       }
     }
     
    @@ -807,15 +802,15 @@ void SMESH_Gen_i::RemoveLastFromPythonScript (int theStudyID)
     //function : SavePython
     //purpose  :
     //=======================================================================
    -void SMESH_Gen_i::SavePython (SALOMEDS::Study_ptr theStudy)
    +void SMESH_Gen_i::SavePython()
     {
       // Dump trace of API methods calls
    -  TCollection_AsciiString aScript = GetNewPythonLines(theStudy->StudyId());
    +  TCollection_AsciiString aScript = GetNewPythonLines();
     
       // Check contents of PythonObject attribute
       CORBA::String_var compDataType = ComponentDataType();
    -  SALOMEDS::SObject_wrap aSO = theStudy->FindComponent( compDataType.in() );
    -  SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
    +  SALOMEDS::SObject_wrap aSO = getStudyServant()->FindComponent( compDataType.in() );
    +  SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
       SALOMEDS::GenericAttribute_wrap anAttr =
         aStudyBuilder->FindOrCreateAttribute(aSO, "AttributePythonObject");
     
    @@ -835,7 +830,7 @@ void SMESH_Gen_i::SavePython (SALOMEDS::Study_ptr theStudy)
       pyAttr->SetObject(oldScript.ToCString(), 1);
     
       // Clean trace of API methods calls
    -  CleanPythonTrace(theStudy->StudyId());
    +  CleanPythonTrace();
     }
     
     
    @@ -979,7 +974,6 @@ namespace {
     //================================================================================
     /*!
      * \brief Createa a Dump Python script
    - *  \param [in] theStudy - the study to dump
      *  \param [in,out] theObjectNames - map of an entry to a study and python name
      *  \param [in] theNames -  - map of an entry to a study name
      *  \param [in] isPublished - \c true if dump of object publication in study is needed
    @@ -993,8 +987,7 @@ namespace {
     //================================================================================
     
     TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
    -                        (SALOMEDS::Study_ptr                       theStudy,
    -                         Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
    +                        (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                              Resource_DataMapOfAsciiStringAsciiString& theNames,
                              bool                                      isPublished,
                              bool                                      isMultiFile,
    @@ -1003,7 +996,6 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
                              TCollection_AsciiString&                  theSavedTrace)
     {
       SMESH_TRY;
    -  const int aStudyID = theStudy->StudyId();
     
       const TCollection_AsciiString aSmeshpy ( SMESH_2smeshpy::SmeshpyName() );
       const TCollection_AsciiString aSMESHGen( SMESH_2smeshpy::GenName() );
    @@ -1015,9 +1007,9 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       std::list< TCollection_AsciiString >::iterator linesIt;
       
       if ( isPublished )
    -    lines.push_back(  aSMESHGen + " = smeshBuilder.New(theStudy)" );
    +    lines.push_back(  aSMESHGen + " = smeshBuilder.New()" );
        else
    -    lines.push_back(  aSMESHGen + " = smeshBuilder.New(None)" );
    +    lines.push_back(  aSMESHGen + " = smeshBuilder.New(False)" );
       lines.push_back( helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()" );
       lines.push_back( helper + "aMeasurements = "  + aSMESHGen + ".CreateMeasurements()" );
     
    @@ -1063,9 +1055,9 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       }
     
       // Add new dump trace of API methods calls to script lines
    -  if (myPythonScripts.find( aStudyID ) != myPythonScripts.end())
    +  if (!myPythonScript.IsNull())
       {
    -    Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScripts[ aStudyID ];
    +    Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScript;
         Standard_Integer istr, aLen = aPythonScript->Length();
         for (istr = 1; istr <= aLen; istr++)
           lines.push_back( aPythonScript->Value( istr ));
    @@ -1079,7 +1071,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       if ( !getenv("NO_2smeshpy_conversion"))
         SMESH_2smeshpy::ConvertScript( lines, anEntry2AccessorMethod,
                                        theObjectNames, aRemovedObjIDs,
    -                                   theStudy, isHistoricalDump );
    +                                   isHistoricalDump );
     
       bool importGeom = false;
       GEOM::GEOM_Gen_ptr geom = GetGeomEngine();
    @@ -1218,7 +1210,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       }
     
       if ( isMultiFile )
    -    initPart += "def RebuildData(theStudy):";
    +    initPart += "def RebuildData():";
       initPart += "\n";
     
       anUpdatedScript.Prepend( initPart );
    @@ -1229,12 +1221,12 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       TCollection_AsciiString removeObjPart;
       if ( !mapRemoved.IsEmpty() ) {
         removeObjPart += nt + "## some objects were removed";
    -    removeObjPart += nt + "aStudyBuilder = theStudy.NewBuilder()";
    +    removeObjPart += nt + "aStudyBuilder = salome.myStudy.NewBuilder()";
         Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString mapRemovedIt;
         for ( mapRemovedIt.Initialize( mapRemoved ); mapRemovedIt.More(); mapRemovedIt.Next() ) {
           aName   = mapRemovedIt.Value(); // python name
           anEntry = mapRemovedIt.Key();
    -      removeObjPart += nt + "SO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(";
    +      removeObjPart += nt + "SO = salome.myStudy.FindObjectIOR(salome.myStudy.ConvertObjectToIOR(";
           removeObjPart += aName;
           // for object wrapped by class of smeshBuilder.py
           if ( anEntry2AccessorMethod.IsBound( anEntry ) )
    @@ -1272,7 +1264,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
       {
         //Output the script that sets up the visual parameters.
         CORBA::String_var compDataType = ComponentDataType();
    -    CORBA::String_var script = theStudy->GetDefaultScript( compDataType.in(), tab.ToCString() );
    +    CORBA::String_var script = getStudyServant()->GetDefaultScript( compDataType.in(), tab.ToCString() );
         if ( script.in() && script.in()[0] ) {
           visualPropertiesPart += nt + "### Store presentation parameters of displayed objects\n";
           visualPropertiesPart += script.in();
    @@ -1289,9 +1281,9 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
           "\nif __name__ == '__main__':"
           "\n\tSMESH_RebuildData = RebuildData"
           "\n\texec('import '+re.sub('SMESH$','GEOM',thisModule)+' as GEOM_dump')"
    -      "\n\tGEOM_dump.RebuildData( salome.myStudy )"
    +      "\n\tGEOM_dump.RebuildData()"
           "\n\texec('from '+re.sub('SMESH$','GEOM',thisModule)+' import * ')"
    -      "\n\tSMESH_RebuildData( salome.myStudy )";
    +      "\n\tSMESH_RebuildData()";
       }
       anUpdatedScript += "\n";
     
    @@ -1368,13 +1360,13 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
      *  GetNewPythonLines
      */
     //=============================================================================
    -TCollection_AsciiString SMESH_Gen_i::GetNewPythonLines (int theStudyID)
    +TCollection_AsciiString SMESH_Gen_i::GetNewPythonLines()
     {
       TCollection_AsciiString aScript;
     
       // Dump trace of API methods calls
    -  if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
    -    Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScripts[theStudyID];
    +  if (!myPythonScript.IsNull()) {
    +    Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScript;
         Standard_Integer istr, aLen = aPythonScript->Length();
         for (istr = 1; istr <= aLen; istr++) {
           aScript += "\n";
    @@ -1391,12 +1383,12 @@ TCollection_AsciiString SMESH_Gen_i::GetNewPythonLines (int theStudyID)
      *  CleanPythonTrace
      */
     //=============================================================================
    -void SMESH_Gen_i::CleanPythonTrace (int theStudyID)
    +void SMESH_Gen_i::CleanPythonTrace()
     {
       TCollection_AsciiString aScript;
     
       // Clean trace of API methods calls
    -  if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
    -    myPythonScripts[theStudyID]->Clear();
    +  if (!myPythonScript.IsNull()) {
    +    myPythonScript->Clear();
       }
     }
    diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx
    index 9432b9117..a255fa53f 100644
    --- a/src/SMESH_I/SMESH_Filter_i.cxx
    +++ b/src/SMESH_I/SMESH_Filter_i.cxx
    @@ -138,18 +138,14 @@ static TopoDS_Shape getShapeByName( const char* theName )
       if ( theName != 0 )
       {
         SMESH_Gen_i* aSMESHGen     = SMESH_Gen_i::GetSMESHGen();
    -    SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
    -    if ( !aStudy->_is_nil() )
    +    SALOMEDS::Study::ListOfSObject_var aList = SMESH_Gen_i::getStudyServant()->FindObjectByName( theName, "GEOM" );
    +    if ( aList->length() > 0 )
         {
    -      SALOMEDS::Study::ListOfSObject_var aList = aStudy->FindObjectByName( theName, "GEOM" );
    -      if ( aList->length() > 0 )
    -      {
    -        CORBA::Object_var        anObj = aList[ 0 ]->GetObject();
    -        GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( anObj );
    -        TopoDS_Shape             shape = aSMESHGen->GeomObjectToShape( aGeomObj );
    -        SALOME::UnRegister( aList ); // UnRegister() objects in aList
    -        return shape;
    -      }
    +      CORBA::Object_var        anObj = aList[ 0 ]->GetObject();
    +      GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( anObj );
    +      TopoDS_Shape             shape = aSMESHGen->GeomObjectToShape( aGeomObj );
    +      SALOME::UnRegister( aList ); // UnRegister() objects in aList
    +      return shape;
         }
       }
       return TopoDS_Shape();
    @@ -159,14 +155,11 @@ static TopoDS_Shape getShapeByID (const char* theID)
     {
       if ( theID && strlen( theID ) > 0 ) {
         SMESH_Gen_i*     aSMESHGen = SMESH_Gen_i::GetSMESHGen();
    -    SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
    -    if ( !aStudy->_is_nil() ) {
    -      SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID);
    -      if ( !aSObj->_is_nil() ) {
    -        CORBA::Object_var          obj = aSObj->GetObject();
    -        GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(obj);
    -        return aSMESHGen->GeomObjectToShape( aGeomObj );
    -      }
    +    SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID(theID);
    +    if ( !aSObj->_is_nil() ) {
    +      CORBA::Object_var          obj = aSObj->GetObject();
    +      GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(obj);
    +      return aSMESHGen->GeomObjectToShape( aGeomObj );
         }
       }
       return TopoDS_Shape();
    @@ -175,14 +168,10 @@ static TopoDS_Shape getShapeByID (const char* theID)
     // static std::string getShapeNameByID (const char* theID)
     // {
     //   if ( theID && strlen( theID ) > 0 ) {
    -//     SMESH_Gen_i*     aSMESHGen = SMESH_Gen_i::GetSMESHGen();
    -//     SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
    -//     if ( !aStudy->_is_nil() ) {
    -//       SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID);
    -//       if ( !aSObj->_is_nil() ) {
    -//         CORBA::String_var name = aSObj->GetName();
    -//         return name.in();
    -//       }
    +//     SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID(theID);
    +//     if ( !aSObj->_is_nil() ) {
    +//       CORBA::String_var name = aSObj->GetName();
    +//       return name.in();
     //     }
     //   }
     //   return "";
    @@ -779,14 +768,10 @@ void BelongToMeshGroup_i::SetGroupID( const char* theID ) // IOR or StoreName
       }
       else if ( strncmp( "0:", myID.c_str(), 2 ) == 0 ) // transient mode + GUI
       {
    -    SMESH_Gen_i* aSMESHGen     = SMESH_Gen_i::GetSMESHGen();
    -    SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
    -    if ( !aStudy->_is_nil() ) {
    -      SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID( myID.c_str() );
    -      if ( !aSObj->_is_nil() ) {
    -        CORBA::Object_var obj = aSObj->GetObject();
    -        SetGroup( SMESH::SMESH_GroupBase::_narrow( obj ));
    -      }
    +    SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( myID.c_str() );
    +    if ( !aSObj->_is_nil() ) {
    +      CORBA::Object_var obj = aSObj->GetObject();
    +      SetGroup( SMESH::SMESH_GroupBase::_narrow( obj ));
         }
       }
       else if ( !myID.empty() ) // persistent mode
    @@ -812,7 +797,7 @@ SMESH::SMESH_GroupBase_ptr BelongToMeshGroup_i::GetGroup()
       {
         // search for a group in a current study
         SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
    -    if ( StudyContext*  sc = aSMESHGen->GetCurrentStudyContext() )
    +    if ( StudyContext*  sc = aSMESHGen->GetStudyContext() )
         {
           int id = 1;
           std::string ior;
    @@ -1677,11 +1662,7 @@ void ConnectedElements_i::SetThreshold ( const char*
         }
       case SMESH::ConnectedElements::VERTEX: // get a VERTEX by its entry /////////////////
         {
    -      SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
    -      if ( study->_is_nil() )
    -        THROW_SALOME_CORBA_EXCEPTION
    -          ( "ConnectedElements_i::SetThreshold(): NULL current study", SALOME::BAD_PARAM );
    -      SALOMEDS::SObject_wrap sobj = study->FindObjectID( threshold );
    +      SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( threshold );
           if ( sobj->_is_nil() )
             THROW_SALOME_CORBA_EXCEPTION
               ( "ConnectedElements_i::SetThreshold(): invalid vertex study entry", SALOME::BAD_PARAM );
    diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx
    index 916a1f222..072d11800 100644
    --- a/src/SMESH_I/SMESH_Gen_i.cxx
    +++ b/src/SMESH_I/SMESH_Gen_i.cxx
    @@ -293,7 +293,10 @@ SMESH_Gen_i::SMESH_Gen_i( CORBA::ORB_ptr            orb,
       _thisObj = this ;
       _id = myPoa->activate_object( _thisObj );
     
    +  myStudyContext = new StudyContext;
    +
       myIsEmbeddedMode = false;
    +  myIsEnablePublish = true;
       myShapeReader = NULL;  // shape reader
       mySMESHGen = this;
       myIsHistoricalPythonDump = true;
    @@ -351,11 +354,8 @@ SMESH_Gen_i::~SMESH_Gen_i()
       myHypCreatorMap.clear();
     
       // Clear study contexts data
    -  map::iterator it;
    -  for ( it = myStudyContextMap.begin(); it != myStudyContextMap.end(); ++it ) {
    -    delete it->second;
    -  }
    -  myStudyContextMap.clear();
    +  delete myStudyContext;
    +
       // delete shape reader
       if ( myShapeReader )
         delete myShapeReader;
    @@ -480,7 +480,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName
         getHypothesisCreator(theHypName, theLibName, aPlatformLibName);
     
       // create a new hypothesis object, store its ref. in studyContext
    -  myHypothesis_i = aCreator->Create(myPoa, GetCurrentStudyID(), &myGen);
    +  myHypothesis_i = aCreator->Create(myPoa, &myGen);
       if (myHypothesis_i)
       {
         myHypothesis_i->SetLibName( aPlatformLibName.c_str() ); // for persistency assurance
    @@ -512,10 +512,10 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::createMesh()
       // Get or create the GEOM_Client instance
       try {
         // create a new mesh object servant, store it in a map in study context
    -    SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this, GetCurrentStudyID() );
    +    SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this );
         // create a new mesh object
         if(MYDEBUG) MESSAGE("myIsEmbeddedMode " << myIsEmbeddedMode);
    -    meshServant->SetImpl( myGen.CreateMesh( GetCurrentStudyID(), myIsEmbeddedMode ));
    +    meshServant->SetImpl( myGen.CreateMesh( myIsEmbeddedMode ));
     
         // activate the CORBA servant of Mesh
         SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( meshServant->_this() );
    @@ -609,47 +609,59 @@ CORBA::Boolean SMESH_Gen_i::IsEmbeddedMode()
     
     //=============================================================================
     /*!
    - *  SMESH_Gen_i::SetCurrentStudy
    + *  SMESH_Gen_i::SetEnablePublish
      *
    - *  Set current study
    + *  Set enable publishing in the study
    + */
    +//=============================================================================
    +void SMESH_Gen_i::SetEnablePublish( CORBA::Boolean theIsEnablePublish )
    +{
    +  myIsEnablePublish = theIsEnablePublish;
    +}
    +
    +//=============================================================================
    +/*!
    + *  SMESH_Gen_i::IsEnablePublish
    + *
    + *  Check enable publishing
      */
     //=============================================================================
     
    -void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
    +CORBA::Boolean SMESH_Gen_i::IsEnablePublish()
     {
    -  setCurrentStudy( theStudy );
    +  return myIsEnablePublish;
     }
     
    -void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy,
    -                                   bool                theStudyIsBeingClosed)
    -{
    -  int curStudyId = GetCurrentStudyID();
    -  myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy );
    -  // create study context, if it doesn't exist and set current study
    -  int studyId = GetCurrentStudyID();
    -  if ( myStudyContextMap.find( studyId ) == myStudyContextMap.end() )
    -    myStudyContextMap[ studyId ] = new StudyContext;
    +//=============================================================================
    +/*!
    + *  SMESH_Gen_i::UpdateStudy
    + *
    + *  Update study (needed at switching GEOM->SMESH)
    + */
    +//=============================================================================
     
    -  // myCurrentStudy may be nil
    -  if ( !theStudyIsBeingClosed && !CORBA::is_nil( myCurrentStudy ) ) {
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
    -    SALOMEDS::SComponent_wrap GEOM_var = myCurrentStudy->FindComponent( "GEOM" );
    +void SMESH_Gen_i::UpdateStudy()
    +{
    +  if ( !myStudyContext )
    +    myStudyContext = new StudyContext;
    +
    +  SALOMEDS::Study_var aStudy = getStudyServant();
    +  if ( !CORBA::is_nil( aStudy ) ) {
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
    +    SALOMEDS::SComponent_wrap GEOM_var = aStudy->FindComponent( "GEOM" );
         if( !GEOM_var->_is_nil() )
           aStudyBuilder->LoadWith( GEOM_var, GetGeomEngine() );
         // NPAL16168, issue 0020210
         // Let meshes update their data depending on GEOM groups that could change
    -    if ( curStudyId != studyId )
    -    {
    -      CORBA::String_var compDataType = ComponentDataType();
    -      SALOMEDS::SComponent_wrap me = myCurrentStudy->FindComponent( compDataType.in() );
    -      if ( !me->_is_nil() ) {
    -        SALOMEDS::ChildIterator_wrap anIter = myCurrentStudy->NewChildIterator( me );
    -        for ( ; anIter->More(); anIter->Next() ) {
    -          SALOMEDS::SObject_wrap so = anIter->Value();
    -          CORBA::Object_var     ior = SObjectToObject( so );
    -          if ( SMESH_Mesh_i*   mesh = SMESH::DownCast( ior ))
    -            mesh->CheckGeomModif();
    -        }
    +    CORBA::String_var compDataType = ComponentDataType();
    +    SALOMEDS::SComponent_wrap me = aStudy->FindComponent( compDataType.in() );
    +    if ( !me->_is_nil() ) {
    +      SALOMEDS::ChildIterator_wrap anIter = aStudy->NewChildIterator( me );
    +      for ( ; anIter->More(); anIter->Next() ) {
    +        SALOMEDS::SObject_wrap so = anIter->Value();
    +        CORBA::Object_var     ior = SObjectToObject( so );
    +        if ( SMESH_Mesh_i*   mesh = SMESH::DownCast( ior ))
    +          mesh->CheckGeomModif();
           }
         }
       }
    @@ -657,34 +669,14 @@ void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy,
     
     //=============================================================================
     /*!
    - *  SMESH_Gen_i::GetCurrentStudy
    + *  SMESH_Gen_i::GetStudyContext
      *
    - *  Get current study
    + *  Get study context
      */
     //=============================================================================
    -
    -SALOMEDS::Study_ptr SMESH_Gen_i::GetCurrentStudy()
    +StudyContext* SMESH_Gen_i::GetStudyContext()
     {
    -  if(MYDEBUG) MESSAGE( "SMESH_Gen_i::GetCurrentStudy: study Id = " << GetCurrentStudyID() );
    -  if ( GetCurrentStudyID() < 0 )
    -    return SALOMEDS::Study::_nil();
    -  return SALOMEDS::Study::_duplicate( myCurrentStudy );
    -}
    -
    -//=============================================================================
    -/*!
    - *  SMESH_Gen_i::GetCurrentStudyContext
    - *
    - *  Get current study context
    - */
    -//=============================================================================
    -StudyContext* SMESH_Gen_i::GetCurrentStudyContext()
    -{
    -  if ( !CORBA::is_nil( myCurrentStudy ) &&
    -       myStudyContextMap.find( GetCurrentStudyID() ) != myStudyContextMap.end() )
    -    return myStudyContextMap[ myCurrentStudy->StudyId() ];
    -  else
    -    return 0;
    +  return myStudyContext;
     }
     
     //=============================================================================
    @@ -705,7 +697,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::CreateHypothesis( const char* theHypNam
     
       // Publish hypothesis/algorithm in the study
       if ( CanPublishInStudy( hyp ) ) {
    -    SALOMEDS::SObject_wrap aSO = PublishHypothesis( myCurrentStudy, hyp );
    +    SALOMEDS::SObject_wrap aSO = PublishHypothesis( hyp );
         if ( !aSO->_is_nil() ) {
           // Update Python script
           TPythonDump() << aSO << " = " << this << ".CreateHypothesis('"
    @@ -830,12 +822,12 @@ CORBA::Boolean SMESH_Gen_i::GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr
                                                         SMESH::SMESH_Mesh_out       theMesh,
                                                         GEOM::GEOM_Object_out       theShape)
     {
    -  if ( GetCurrentStudyID() < 0 || CORBA::is_nil( theHyp ))
    +  if ( CORBA::is_nil( theHyp ))
         return false;
     
       // get Mesh component SO
       CORBA::String_var compDataType = ComponentDataType();
    -  SALOMEDS::SComponent_wrap comp = myCurrentStudy->FindComponent( compDataType.in() );
    +  SALOMEDS::SComponent_wrap comp = getStudyServant()->FindComponent( compDataType.in() );
       if ( CORBA::is_nil( comp ))
         return false;
     
    @@ -843,7 +835,7 @@ CORBA::Boolean SMESH_Gen_i::GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr
       SMESH::SMESH_Mesh_var foundMesh;
       TopoDS_Shape          foundShape;
       bool                  isSole = true;
    -  SALOMEDS::ChildIterator_wrap meshIter = myCurrentStudy->NewChildIterator( comp );
    +  SALOMEDS::ChildIterator_wrap meshIter = getStudyServant()->NewChildIterator( comp );
       for ( ; meshIter->More() && isSole; meshIter->Next() )
       {
         SALOMEDS::SObject_wrap curSO = meshIter->Value();
    @@ -1049,9 +1041,9 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMesh( GEOM::GEOM_Object_ptr theShapeObj
     
       // publish mesh in the study
       if ( CanPublishInStudy( mesh ) ) {
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
         aStudyBuilder->NewCommand();  // There is a transaction
    -    SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, mesh.in() );
    +    SALOMEDS::SObject_wrap aSO = PublishMesh( mesh.in() );
         aStudyBuilder->CommitCommand();
         if ( !aSO->_is_nil() ) {
           // Update Python script
    @@ -1080,9 +1072,9 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateEmptyMesh()
     
       // publish mesh in the study
       if ( CanPublishInStudy( mesh ) ) {
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
         aStudyBuilder->NewCommand();  // There is a transaction
    -    SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, mesh.in() );
    +    SALOMEDS::SObject_wrap aSO = PublishMesh( mesh.in() );
         aStudyBuilder->CommitCommand();
         if ( !aSO->_is_nil() ) {
           // Update Python script
    @@ -1135,9 +1127,9 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromUNV( const char* theFileName
       string aFileName;
       // publish mesh in the study
       if ( CanPublishInStudy( aMesh ) ) {
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
         aStudyBuilder->NewCommand();  // There is a transaction
    -    SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, aMesh.in(), aFileName.c_str() );
    +    SALOMEDS::SObject_wrap aSO = PublishMesh( aMesh.in(), aFileName.c_str() );
         aStudyBuilder->CommitCommand();
         if ( !aSO->_is_nil() ) {
           // Update Python script
    @@ -1193,11 +1185,9 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
     
       if (theStatus == SMESH::DRS_OK) {
         SALOMEDS::StudyBuilder_var aStudyBuilder;
    -    if ( GetCurrentStudyID() > -1 )
    -    {
    -      aStudyBuilder = myCurrentStudy->NewBuilder();
    -      aStudyBuilder->NewCommand();  // There is a transaction
    -    }
    +    aStudyBuilder = getStudyServant()->NewBuilder();
    +    aStudyBuilder->NewCommand();  // There is a transaction
    +
         aResult->length( aNames.size() );
         int i = 0;
     
    @@ -1216,7 +1206,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa
             // little trick: for MED file theFileName and theFileNameForPython are the same, but they are different for SAUV
             // - as names of meshes are stored in MED file, we use them for data publishing
             // - as mesh name is not stored in UNV file, we use file name as name of mesh when publishing data
    -        aSO = PublishMesh( myCurrentStudy, mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() );
    +        aSO = PublishMesh( mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() );
     
           // Python Dump
           if ( !aSO->_is_nil() ) {
    @@ -1327,10 +1317,9 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromSTL( const char* theFileName
     #endif
       // publish mesh in the study
       if ( CanPublishInStudy( aMesh ) ) {
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
         aStudyBuilder->NewCommand();  // There is a transaction
    -    SALOMEDS::SObject_wrap aSO = PublishInStudy
    -      ( myCurrentStudy, SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
    +    SALOMEDS::SObject_wrap aSO = PublishInStudy( SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
         aStudyBuilder->CommitCommand();
         if ( !aSO->_is_nil() ) {
           // Update Python script
    @@ -1378,7 +1367,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromCGNS( const char* theFileName,
     
         if (theStatus == SMESH::DRS_OK)
         {
    -      SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
    +      SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
           aStudyBuilder->NewCommand();  // There is a transaction
     
           int i = 0;
    @@ -1406,7 +1395,7 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromCGNS( const char* theFileName,
             // publish mesh in the study
             SALOMEDS::SObject_wrap aSO;
             if ( CanPublishInStudy( mesh ) )
    -          aSO = PublishMesh( myCurrentStudy, mesh.in(), meshName.c_str() );
    +          aSO = PublishMesh( mesh.in(), meshName.c_str() );
     
             // Python Dump
             if ( !aSO->_is_nil() ) {
    @@ -1456,10 +1445,9 @@ SMESH_Gen_i::CreateMeshesFromGMF( const char*             theFileName,
     #endif
       // publish mesh in the study
       if ( CanPublishInStudy( aMesh ) ) {
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
         aStudyBuilder->NewCommand();  // There is a transaction
    -    SALOMEDS::SObject_wrap aSO = PublishInStudy
    -      ( myCurrentStudy, SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
    +    SALOMEDS::SObject_wrap aSO = PublishInStudy( SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
         aStudyBuilder->CommitCommand();
         if ( !aSO->_is_nil() ) {
           // Update Python script
    @@ -1526,16 +1514,17 @@ CORBA::Boolean SMESH_Gen_i::IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
     SALOMEDS::SObject_ptr SMESH_Gen_i::GetAlgoSO(const ::SMESH_Algo* algo)
     {
       if ( algo ) {
    -    if ( !myCurrentStudy->_is_nil() ) {
    +  SALOMEDS::Study_var aStudy = getStudyServant();
    +    if ( !aStudy->_is_nil() ) {
           // find algo in the study
           CORBA::String_var compDataType  = ComponentDataType();
    -      SALOMEDS::SComponent_wrap father = myCurrentStudy->FindComponent( compDataType.in() );
    +      SALOMEDS::SComponent_wrap father = aStudy->FindComponent( compDataType.in() );
           if ( !father->_is_nil() ) {
    -        SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( father );
    +        SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( father );
             for ( ; itBig->More(); itBig->Next() ) {
               SALOMEDS::SObject_wrap gotBranch = itBig->Value();
               if ( gotBranch->Tag() == GetAlgorithmsRootTag() ) {
    -            SALOMEDS::ChildIterator_wrap algoIt = myCurrentStudy->NewChildIterator( gotBranch );
    +            SALOMEDS::ChildIterator_wrap algoIt = aStudy->NewChildIterator( gotBranch );
                 for ( ; algoIt->More(); algoIt->Next() ) {
                   SALOMEDS::SObject_wrap algoSO = algoIt->Value();
                   CORBA::Object_var     algoIOR = SObjectToObject( algoSO );
    @@ -2271,16 +2260,16 @@ SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
         GEOM::GEOM_Gen_ptr    geomGen   = GetGeomEngine();
     
         // try to find the corresponding SObject
    -    SALOMEDS::SObject_wrap SObj = ObjectToSObject( myCurrentStudy, geom.in() );
    +    SALOMEDS::SObject_wrap SObj = ObjectToSObject( geom.in() );
         if ( SObj->_is_nil() ) // submesh can be not found even if published
         {
           // try to find published submesh
           GEOM::ListOfLong_var list = geom->GetSubShapeIndices();
           if ( !geom->IsMainShape() && list->length() == 1 ) {
    -        SALOMEDS::SObject_wrap mainSO = ObjectToSObject( myCurrentStudy, mainShape );
    +        SALOMEDS::SObject_wrap mainSO = ObjectToSObject( mainShape );
             SALOMEDS::ChildIterator_wrap it;
             if ( !mainSO->_is_nil() ) {
    -          it = myCurrentStudy->NewChildIterator( mainSO );
    +          it = getStudyServant()->NewChildIterator( mainSO );
             }
             if ( !it->_is_nil() ) {
               for ( it->InitEx(true); it->More(); it->Next() ) {
    @@ -2300,7 +2289,7 @@ SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
           }
         }
         if ( SObj->_is_nil() ) // publish a new subshape
    -      SObj = geomGen->AddInStudy( myCurrentStudy, geom, theGeomName, mainShape );
    +      SObj = geomGen->AddInStudy( geom, theGeomName, mainShape );
     
         // return only published geometry
         if ( !SObj->_is_nil() ) {
    @@ -2348,10 +2337,10 @@ SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
             GEOM::GEOM_Object_var geom = ShapeToGeomObject( meshDS->IndexToShape( shapeID ));
             if ( geom->_is_nil() ) {
               // try to find a published sub-shape
    -          SALOMEDS::SObject_wrap mainSO = ObjectToSObject( myCurrentStudy, mainShape );
    +          SALOMEDS::SObject_wrap mainSO = ObjectToSObject( mainShape );
               SALOMEDS::ChildIterator_wrap it;
               if ( !mainSO->_is_nil() ) {
    -            it = myCurrentStudy->NewChildIterator( mainSO );
    +            it = getStudyServant()->NewChildIterator( mainSO );
               }
               if ( !it->_is_nil() ) {
                 for ( it->InitEx(true); it->More(); it->Next() ) {
    @@ -2370,8 +2359,7 @@ SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr  theMesh,
             }
             if ( geom->_is_nil() ) {
               // explode
    -          GEOM::GEOM_IShapesOperations_wrap op =
    -            geomGen->GetIShapesOperations( GetCurrentStudyID() );
    +          GEOM::GEOM_IShapesOperations_wrap op = geomGen->GetIShapesOperations();
               if ( !op->_is_nil() )
                 geom = op->GetSubShape( mainShape, shapeID );
             }
    @@ -2563,7 +2551,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
               int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 2 : -1 ]; _assert[0]=_assert[1]=0;
             }
             string groupName = "Gr";
    -        SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( myCurrentStudy, theMeshesArray[i] );
    +        SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( theMeshesArray[i] );
             if ( aMeshSObj ) {
               CORBA::String_var name = aMeshSObj->GetName();
               groupName += name;
    @@ -2717,7 +2705,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray,
       }
     
       // IPAL21468 Change icon of compound because it need not be computed.
    -  SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( myCurrentStudy, aNewMesh );
    +  SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( aNewMesh );
       SetPixMap( aMeshSObj, "ICON_SMESH_TREE_MESH" );
     
       if (aNewMeshDS)
    @@ -2764,7 +2752,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
       SMESH_Mesh_i*       newMesh_i = SMESH::DownCast( newMesh );
       if ( !newMesh_i )
         THROW_SALOME_CORBA_EXCEPTION( "can't create a mesh", SALOME::INTERNAL_ERROR );
    -  SALOMEDS::SObject_wrap meshSO = ObjectToSObject(myCurrentStudy, newMesh );
    +  SALOMEDS::SObject_wrap meshSO = ObjectToSObject( newMesh );
       if ( !meshSO->_is_nil() )
       {
         SetName( meshSO, meshName, "Mesh" );
    @@ -3009,16 +2997,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                                           const char*              theURL,
                                           bool                     isMultiFile )
     {
    -  //  ASSERT( theComponent->GetStudy()->StudyId() == myCurrentStudy->StudyId() )
    -  // san -- in case  differs from theComponent's study,
    -  // use that of the component
    -  if ( theComponent->GetStudy()->StudyId() != GetCurrentStudyID() )
    -    SetCurrentStudy( theComponent->GetStudy() );
    +  if (!myStudyContext)
    +    UpdateStudy();
     
       // Store study contents as a set of python commands
    -  SavePython(myCurrentStudy);
    +  SavePython();
     
    -  StudyContext* myStudyContext = GetCurrentStudyContext();
    +  SALOMEDS::Study_var aStudy = getStudyServant();
     
       // Declare a byte stream
       SALOMEDS::TMPFile_var aStreamFile;
    @@ -3028,20 +3013,20 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
         ( isMultiFile ) ? TCollection_AsciiString( ( char* )theURL ) : ( char* )SALOMEDS_Tool::GetTmpDir().c_str();
     
       // Create a sequence of files processed
    -  SALOMEDS::ListOfFileNames_var aFileSeq = new SALOMEDS::ListOfFileNames;
    -  aFileSeq->length( NUM_TMP_FILES );
    +  SALOMEDS_Tool::ListOfFiles aFileSeq;
    +  aFileSeq.reserve( NUM_TMP_FILES );
     
       TCollection_AsciiString aStudyName( "" );
       if ( isMultiFile )
    -    aStudyName = ( (char*)SALOMEDS_Tool::GetNameFromPath( myCurrentStudy->URL() ).c_str() );
    +    aStudyName = ( (char*)SALOMEDS_Tool::GetNameFromPath( aStudy->URL() ).c_str() );
     
       // Set names of temporary files
       TCollection_AsciiString filename =
         aStudyName + TCollection_AsciiString( "_SMESH.hdf" );        // for SMESH data itself
       TCollection_AsciiString meshfile =
         aStudyName + TCollection_AsciiString( "_SMESH_Mesh.med" );   // for mesh data to be stored in MED file
    -  aFileSeq[ 0 ] = CORBA::string_dup( filename.ToCString() );
    -  aFileSeq[ 1 ] = CORBA::string_dup( meshfile.ToCString() );
    +  aFileSeq.push_back(CORBA::string_dup( filename.ToCString() ));
    +  aFileSeq.push_back(CORBA::string_dup( meshfile.ToCString() ));
       filename = tmpDir + filename;
       meshfile = tmpDir + meshfile;
     
    @@ -3075,7 +3060,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
       // SetStoreName() to groups before storing hypotheses to let them refer to
       // groups using "store name", which is "Group "
       {
    -    SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( theComponent );
    +    SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( theComponent );
         for ( ; itBig->More(); itBig->Next() ) {
           SALOMEDS::SObject_wrap gotBranch = itBig->Value();
           if ( gotBranch->Tag() > GetAlgorithmsRootTag() ) {
    @@ -3112,7 +3097,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
       aFile->CreateOnDisk();
     
       // --> iterator for top-level objects
    -  SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( theComponent );
    +  SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( theComponent );
       for ( ; itBig->More(); itBig->Next() ) {
         SALOMEDS::SObject_wrap gotBranch = itBig->Value();
     
    @@ -3123,7 +3108,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
           aTopGroup->CreateOnDisk();
     
           // iterator for all hypotheses
    -      SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( gotBranch );
    +      SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( gotBranch );
           for ( ; it->More(); it->Next() ) {
             SALOMEDS::SObject_wrap mySObject = it->Value();
             CORBA::Object_var anObject = SObjectToObject( mySObject );
    @@ -3192,7 +3177,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
           aTopGroup->CreateOnDisk();
     
           // iterator for all algorithms
    -      SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( gotBranch );
    +      SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( gotBranch );
           for ( ; it->More(); it->Next() ) {
             SALOMEDS::SObject_wrap mySObject = it->Value();
             CORBA::Object_var anObject = SObjectToObject( mySObject );
    @@ -3341,13 +3326,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                 SALOMEDS::SObject_wrap myHypBranch;
                 found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
                 if ( found && !shapeRefFound && hasShape) { // remove applied hyps
    -              myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
    +              aStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
                 }
                 if ( found && (shapeRefFound || !hasShape) ) {
                   aGroup = new HDFgroup( "Applied Hypotheses", aTopGroup );
                   aGroup->CreateOnDisk();
     
    -              SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myHypBranch );
    +              SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myHypBranch );
                   int hypNb = 0;
                   for ( ; it->More(); it->Next() ) {
                     SALOMEDS::SObject_wrap mySObject = it->Value();
    @@ -3385,13 +3370,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                 found = gotBranch->FindSubObject( GetRefOnAppliedAlgorithmsTag(),
                                                   myAlgoBranch.inout() );
                 if ( found && !shapeRefFound && hasShape) { // remove applied algos
    -              myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch );
    +              aStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch );
                 }
                 if ( found && (shapeRefFound || !hasShape)) {
                   aGroup = new HDFgroup( "Applied Algorithms", aTopGroup );
                   aGroup->CreateOnDisk();
     
    -              SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myAlgoBranch );
    +              SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myAlgoBranch );
                   int algoNb = 0;
                   for ( ; it->More(); it->Next() ) {
                     SALOMEDS::SObject_wrap mySObject = it->Value();
    @@ -3434,7 +3419,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                   {
                     bool hasShapeRef = false;
                     SALOMEDS::ChildIterator_wrap itSM =
    -                  myCurrentStudy->NewChildIterator( mySubmeshBranch );
    +                  aStudy->NewChildIterator( mySubmeshBranch );
                     for ( ; itSM->More(); itSM->Next() ) {
                       SALOMEDS::SObject_wrap mySubRef, myShape, mySObject = itSM->Value();
                       if ( mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef.inout() ))
    @@ -3459,11 +3444,11 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                             }
                           }
                         }
    -                    myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( mySObject );
    +                    aStudy->NewBuilder()->RemoveObjectWithChildren( mySObject );
                       }
                     } // loop on submeshes of a type
                     if ( !shapeRefFound || !hasShapeRef ) { // remove the whole submeshes branch
    -                  myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( mySubmeshBranch );
    +                  aStudy->NewBuilder()->RemoveObjectWithChildren( mySubmeshBranch );
                       found = false;
                     }
                   }  // end check if there is shape reference in submeshes
    @@ -3489,7 +3474,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                     aGroup->CreateOnDisk();
     
                     // iterator for all submeshes of given type
    -                SALOMEDS::ChildIterator_wrap itSM = myCurrentStudy->NewChildIterator( mySubmeshBranch );
    +                SALOMEDS::ChildIterator_wrap itSM = aStudy->NewChildIterator( mySubmeshBranch );
                     for ( ; itSM->More(); itSM->Next() ) {
                       SALOMEDS::SObject_wrap mySObject = itSM->Value();
                       CORBA::Object_var anSubObject = SObjectToObject( mySObject );
    @@ -3526,7 +3511,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                           aSubSubGroup = new HDFgroup( "Applied Hypotheses", aSubGroup );
                           aSubSubGroup->CreateOnDisk();
     
    -                      SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( mySubHypBranch );
    +                      SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( mySubHypBranch );
                           int hypNb = 0;
                           for ( ; it->More(); it->Next() ) {
                             SALOMEDS::SObject_wrap mySubSObject = it->Value();
    @@ -3563,7 +3548,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                           aSubSubGroup->CreateOnDisk();
     
                           SALOMEDS::ChildIterator_wrap it =
    -                        myCurrentStudy->NewChildIterator( mySubAlgoBranch );
    +                        aStudy->NewChildIterator( mySubAlgoBranch );
                           int algoNb = 0;
                           for ( ; it->More(); it->Next() ) {
                             SALOMEDS::SObject_wrap mySubSObject = it->Value();
    @@ -3659,7 +3644,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
                     aGroup = new HDFgroup( name_group, aTopGroup );
                     aGroup->CreateOnDisk();
     
    -                SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myGroupsBranch );
    +                SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myGroupsBranch );
                     for ( ; it->More(); it->Next() ) {
                       SALOMEDS::SObject_wrap mySObject = it->Value();
                       CORBA::Object_var aSubObject = SObjectToObject( mySObject );
    @@ -3944,11 +3929,11 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
       delete aFile;
     
       // Convert temporary files to stream
    -  aStreamFile = SALOMEDS_Tool::PutFilesToStream( tmpDir.ToCString(), aFileSeq.in(), isMultiFile );
    +  aStreamFile = SALOMEDS_Tool::PutFilesToStream( tmpDir.ToCString(), aFileSeq, isMultiFile );
     
       // Remove temporary files and directory
       if ( !isMultiFile )
    -    SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq.in(), true );
    +    SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq, true );
     
       return aStreamFile._retn();
     }
    @@ -3995,11 +3980,7 @@ void SMESH_Gen_i::loadGeomData( SALOMEDS::SComponent_ptr theCompRoot )
       if ( theCompRoot->_is_nil() )
         return;
     
    -  SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theCompRoot->GetStudy() );
    -  if ( aStudy->_is_nil() )
    -    return;
    -
    -  SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
    +  SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
       aStudyBuilder->LoadWith( theCompRoot, GetGeomEngine() );
     }
     
    @@ -4016,29 +3997,26 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                             const char*              theURL,
                             bool                     isMultiFile )
     {
    -  if ( theComponent->GetStudy()->StudyId() != GetCurrentStudyID() )
    -    SetCurrentStudy( theComponent->GetStudy() );
    -
    +  if (!myStudyContext)
    +    UpdateStudy();
    +  SALOMEDS::Study_var aStudy = getStudyServant();
       /*  if( !theComponent->_is_nil() )
           {
    -      //SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theComponent->GetStudy() );
    -      if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() )
    -      loadGeomData( myCurrentStudy->FindComponent( "GEOM" ) );
    +      if( !aStudy->FindComponent( "GEOM" )->_is_nil() )
    +      loadGeomData( aStudy->FindComponent( "GEOM" ) );
           }*/
     
    -  StudyContext* myStudyContext = GetCurrentStudyContext();
    -
       // Get temporary files location
       TCollection_AsciiString tmpDir =
         ( char* )( isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir().c_str() );
     
       // Convert the stream into sequence of files to process
    -  SALOMEDS::ListOfFileNames_var aFileSeq = SALOMEDS_Tool::PutStreamToFiles( theStream,
    -                                                                            tmpDir.ToCString(),
    -                                                                            isMultiFile );
    +  SALOMEDS_Tool::ListOfFiles aFileSeq = SALOMEDS_Tool::PutStreamToFiles( theStream,
    +                                                                         tmpDir.ToCString(),
    +                                                                         isMultiFile );
       TCollection_AsciiString aStudyName( "" );
       if ( isMultiFile ) {
    -    CORBA::String_var url = myCurrentStudy->URL();
    +    CORBA::String_var url = aStudy->URL();
         aStudyName = (char*)SALOMEDS_Tool::GetNameFromPath( url.in() ).c_str();
       }
       // Set names of temporary files
    @@ -4343,7 +4321,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                 aDataset->ReadFromDisk( refFromFile );
                 aDataset->CloseOnDisk();
                 if ( strlen( refFromFile ) > 0 ) {
    -              SALOMEDS::SObject_wrap shapeSO = myCurrentStudy->FindObjectID( refFromFile );
    +              SALOMEDS::SObject_wrap shapeSO = aStudy->FindObjectID( refFromFile );
     
                   // Make sure GEOM data are loaded first
                   //loadGeomData( shapeSO->GetFatherComponent() );
    @@ -4442,7 +4420,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                 aDataset->ReadFromDisk( refFromFile );
                 aDataset->CloseOnDisk();
                 // san - it is impossible to recover applied algorithms using their entries within Load() method
    -            //SALOMEDS::SObject_wrap hypSO = myCurrentStudy->FindObjectID( refFromFile );
    +            //SALOMEDS::SObject_wrap hypSO = aStudy->FindObjectID( refFromFile );
                 //CORBA::Object_var hypObject = SObjectToObject( hypSO );
                 int id = atoi( refFromFile );
                 delete [] refFromFile;
    @@ -4479,7 +4457,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                 aDataset->ReadFromDisk( refFromFile );
                 aDataset->CloseOnDisk();
                 // san - it is impossible to recover applied hypotheses using their entries within Load() method
    -            //SALOMEDS::SObject_wrap hypSO = myCurrentStudy->FindObjectID( refFromFile );
    +            //SALOMEDS::SObject_wrap hypSO = myStudy->FindObjectID( refFromFile );
                 //CORBA::Object_var hypObject = SObjectToObject( hypSO );
                 int id = atoi( refFromFile );
                 delete [] refFromFile;
    @@ -4550,7 +4528,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                     aDataset->ReadFromDisk( refFromFile );
                     aDataset->CloseOnDisk();
                     if ( strlen( refFromFile ) > 0 ) {
    -                  SALOMEDS::SObject_wrap subShapeSO = myCurrentStudy->FindObjectID( refFromFile );
    +                  SALOMEDS::SObject_wrap subShapeSO = aStudy->FindObjectID( refFromFile );
                       CORBA::Object_var subShapeObject = SObjectToObject( subShapeSO );
                       if ( !CORBA::is_nil( subShapeObject ) ) {
                         aSubShapeObject = GEOM::GEOM_Object::_narrow( subShapeObject );
    @@ -4700,7 +4678,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
                     aDataset->ReadFromDisk( refFromFile );
                     aDataset->CloseOnDisk();
                     if ( strlen( refFromFile ) > 0 ) {
    -                  SALOMEDS::SObject_wrap shapeSO = myCurrentStudy->FindObjectID( refFromFile );
    +                  SALOMEDS::SObject_wrap shapeSO = aStudy->FindObjectID( refFromFile );
                       CORBA::Object_var shapeObject = SObjectToObject( shapeSO );
                       if ( !CORBA::is_nil( shapeObject ) ) {
                         aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject );
    @@ -4850,7 +4828,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
         SMESH_File meshFile( meshfile.ToCString() );
         if ( !meshFile ) // no meshfile exists
         {
    -      SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq.in(), true );
    +      SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq, true );
         }
         else
         {
    @@ -4867,12 +4845,11 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
     
       // creation of tree nodes for all data objects in the study
       // to support tree representation customization and drag-n-drop:
    -  SALOMEDS::Study_var                    study = theComponent->GetStudy();
    -  SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = study->GetUseCaseBuilder();
    +  SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
       if ( !useCaseBuilder->IsUseCaseNode( theComponent ) ) {
         useCaseBuilder->SetRootCurrent();
         useCaseBuilder->Append( theComponent ); // component object is added as the top level item
    -    SALOMEDS::ChildIterator_wrap it = study->NewChildIterator( theComponent );
    +    SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( theComponent );
         for (it->InitEx(true); it->More(); it->Next()) {
           useCaseBuilder->AppendTo( it->Value()->GetFather(), it->Value() );
         }
    @@ -4932,22 +4909,13 @@ void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent )
     {
       if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Close" );
     
    -  // set correct current study
    -  SALOMEDS::Study_var study = theComponent->GetStudy();
    -  if ( study->StudyId() != GetCurrentStudyID())
    -    setCurrentStudy( study, /*IsBeingClosed=*/true );
    -
       // Clear study contexts data
    -  int studyId = GetCurrentStudyID();
    -  if ( myStudyContextMap.find( studyId ) != myStudyContextMap.end() ) {
    -    delete myStudyContextMap[ studyId ];
    -    myStudyContextMap.erase( studyId );
    -  }
    +  delete myStudyContext;
    +  myStudyContext = 0;
     
       // remove the tmp files meshes are loaded from
       SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent );
     
    -  myCurrentStudy = SALOMEDS::Study::_nil();
       return;
     }
     
    @@ -4980,7 +4948,6 @@ char* SMESH_Gen_i::IORToLocalPersistentID( SALOMEDS::SObject_ptr /*theSObject*/,
                                                CORBA::Boolean        /*isASCII*/ )
     {
       if(MYDEBUG) MESSAGE( "SMESH_Gen_i::IORToLocalPersistentID" );
    -  StudyContext* myStudyContext = GetCurrentStudyContext();
     
       if ( myStudyContext && strcmp( IORString, "" ) != 0 ) {
         int anId = myStudyContext->findId( IORString );
    @@ -5008,7 +4975,6 @@ char* SMESH_Gen_i::LocalPersistentIDToIOR( SALOMEDS::SObject_ptr /*theSObject*/,
                                                CORBA::Boolean        /*isASCII*/ )
     {
       if(MYDEBUG) MESSAGE( "SMESH_Gen_i::LocalPersistentIDToIOR(): id = " << aLocalPersistentID );
    -  StudyContext* myStudyContext = GetCurrentStudyContext();
     
       if ( myStudyContext && strcmp( aLocalPersistentID, "" ) != 0 ) {
         int anId = atoi( aLocalPersistentID );
    @@ -5024,7 +4990,6 @@ char* SMESH_Gen_i::LocalPersistentIDToIOR( SALOMEDS::SObject_ptr /*theSObject*/,
     
     int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject)
     {
    -  StudyContext* myStudyContext = GetCurrentStudyContext();
       if ( myStudyContext && !CORBA::is_nil( theObject )) {
         CORBA::String_var iorString = GetORB()->object_to_string( theObject );
         return myStudyContext->addObject( string( iorString.in() ) );
    @@ -5042,7 +5007,6 @@ int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject)
     
     CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
     {
    -  StudyContext* myStudyContext = GetCurrentStudyContext();
       if ( myStudyContext && !CORBA::is_nil( theObject )) {
         string iorString = GetORB()->object_to_string( theObject );
         return myStudyContext->findId( iorString );
    @@ -5062,18 +5026,13 @@ void SMESH_Gen_i::SetName(const char* theIOR,
     {
       if ( theIOR && strcmp( theIOR, "" ) ) {
         CORBA::Object_var anObject = GetORB()->string_to_object( theIOR );
    -    SALOMEDS::SObject_wrap aSO = ObjectToSObject( myCurrentStudy, anObject );
    +    SALOMEDS::SObject_wrap aSO = ObjectToSObject( anObject );
         if ( !aSO->_is_nil() ) {
           SetName( aSO, theName );
         }
       }
     }
     
    -int SMESH_Gen_i::GetCurrentStudyID()
    -{
    -  return myCurrentStudy->_is_nil() || myCurrentStudy->_non_existent() ? -1 : myCurrentStudy->StudyId();
    -}
    -
     // Version information
     char* SMESH_Gen_i::getVersion()
     {
    @@ -5095,9 +5054,8 @@ void SMESH_Gen_i::Move( const SMESH::sobject_list& what,
     {
       if ( CORBA::is_nil( where ) ) return;
     
    -  SALOMEDS::Study_var study = where->GetStudy();
    -  SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
    -  SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder();
    +  SALOMEDS::StudyBuilder_var studyBuilder = getStudyServant()->NewBuilder();
    +  SALOMEDS::UseCaseBuilder_var useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
       SALOMEDS::SComponent_var father = where->GetFatherComponent();
       std::string dataType = father->ComponentDataType();
       if ( dataType != "SMESH" ) return; // not a SMESH component
    diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx
    index 1e869462c..53921ba64 100644
    --- a/src/SMESH_I/SMESH_Gen_i.hxx
    +++ b/src/SMESH_I/SMESH_Gen_i.hxx
    @@ -154,8 +154,9 @@ public:
       // Get CORBA object corresponding to the SALOMEDS::SObject
       static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
       // Get the SALOMEDS::SObject corresponding to a CORBA object
    -  static SALOMEDS::SObject_ptr ObjectToSObject(SALOMEDS::Study_ptr theStudy,
    -                                               CORBA::Object_ptr   theObject);
    +  static SALOMEDS::SObject_ptr ObjectToSObject(CORBA::Object_ptr theObject);
    +  // Get the SALOMEDS::Study from naming service
    +  static SALOMEDS::Study_ptr getStudyServant();
       // Get GEOM Object correspoding to TopoDS_Shape
       GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
       // Get TopoDS_Shape correspoding to GEOM_Object
    @@ -182,15 +183,19 @@ public:
       //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
       void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
     
    -  // Set current study
    +  // Set embedded mode
       void SetEmbeddedMode( CORBA::Boolean theMode );
    -  // Get current study
    +  // Check embedded mode
       CORBA::Boolean IsEmbeddedMode();
     
    -  // Set current study
    -  void SetCurrentStudy( SALOMEDS::Study_ptr theStudy );
    -  // Get current study
    -  SALOMEDS::Study_ptr GetCurrentStudy();
    +  // Set enable publishing in the study
    +  void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
    +
    +  // Check enable publishing
    +  CORBA::Boolean IsEnablePublish();
    +
    +  // Update study
    +  void UpdateStudy();
     
       // Create hypothesis/algorothm of given type
       SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
    @@ -437,8 +442,7 @@ public:
       // Returns true if object can be published in the study
       bool CanPublishInStudy( CORBA::Object_ptr theIOR );
       // Publish object in the study
    -  SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::Study_ptr   theStudy,
    -                                        SALOMEDS::SObject_ptr theSObject,
    +  SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
                                             CORBA::Object_ptr     theObject,
                                             const char*           theName )
         throw ( SALOME::SALOME_Exception );
    @@ -467,19 +471,17 @@ public:
       // Dump python
       // ============
     
    -  virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
    -                                       CORBA::Boolean isPublished,
    +  virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
                                            CORBA::Boolean isMultiFile,
                                            CORBA::Boolean& isValidScript);
     
    -  void AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString);
    +  void AddToPythonScript (const TCollection_AsciiString& theString);
     
    -  void RemoveLastFromPythonScript (int theStudyID);
    +  void RemoveLastFromPythonScript();
     
    -  void SavePython (SALOMEDS::Study_ptr theStudy);
    +  void SavePython();
     
    -  TCollection_AsciiString DumpPython_impl (SALOMEDS::Study_ptr theStudy,
    -                                           Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
    +  TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                                                Resource_DataMapOfAsciiStringAsciiString& theNames,
                                                bool isPublished,
                                                bool isMultiFile,
    @@ -487,9 +489,9 @@ public:
                                                bool& aValidScript,
                                                TCollection_AsciiString& theSavedTrace);
     
    -  TCollection_AsciiString GetNewPythonLines (int theStudyID);
    +  TCollection_AsciiString GetNewPythonLines();
     
    -  void CleanPythonTrace (int theStudyID);
    +  void CleanPythonTrace();
     
       // *****************************************
       // Internal methods
    @@ -519,33 +521,26 @@ public:
       static long GetBallElementsGroupsTag();
     
       // publishing methods
    -  SALOMEDS::SComponent_ptr PublishComponent(SALOMEDS::Study_ptr theStudy);
    -  SALOMEDS::SObject_ptr PublishMesh (SALOMEDS::Study_ptr   theStudy,
    -                                     SMESH::SMESH_Mesh_ptr theMesh,
    +  SALOMEDS::SComponent_ptr PublishComponent();
    +  SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
                                          const char*           theName = 0);
    -  SALOMEDS::SObject_ptr PublishHypothesis (SALOMEDS::Study_ptr         theStudy,
    -                                           SMESH::SMESH_Hypothesis_ptr theHyp,
    +  SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
                                                const char*                 theName = 0);
    -  SALOMEDS::SObject_ptr PublishSubMesh (SALOMEDS::Study_ptr      theStudy,
    -                                        SMESH::SMESH_Mesh_ptr    theMesh,
    +  SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr    theMesh,
                                             SMESH::SMESH_subMesh_ptr theSubMesh,
                                             GEOM::GEOM_Object_ptr    theShapeObject,
                                             const char*              theName = 0);
    -  SALOMEDS::SObject_ptr PublishGroup (SALOMEDS::Study_ptr    theStudy,
    -                                      SMESH::SMESH_Mesh_ptr  theMesh,
    +  SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr  theMesh,
                                           SMESH::SMESH_GroupBase_ptr theGroup,
                                           GEOM::GEOM_Object_ptr  theShapeObject,
                                           const char*            theName = 0);
    -  bool AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
    -                            SMESH::SMESH_Mesh_ptr       theMesh,
    +  bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr       theMesh,
                                 GEOM::GEOM_Object_ptr       theShapeObject,
                                 SMESH::SMESH_Hypothesis_ptr theHyp);
    -  bool RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy,
    -                                 SMESH::SMESH_Mesh_ptr       theMesh,
    +  bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr       theMesh,
                                      GEOM::GEOM_Object_ptr       theShapeObject,
                                      SMESH::SMESH_Hypothesis_ptr theHyp);
    -  SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SALOMEDS::Study_ptr   theStudy,
    -                                                 SMESH::SMESH_Mesh_ptr theMesh,
    +  SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
                                                      GEOM::GEOM_Object_ptr theShape);
       static void SetName(SALOMEDS::SObject_ptr theSObject,
                           const char*           theName,
    @@ -555,7 +550,7 @@ public:
                             const char*           thePixMap);
     
       //  Get study context
    -  StudyContext* GetCurrentStudyContext();
    +  StudyContext* GetStudyContext();
     
       // Register an object in a StudyContext; return object id
       int RegisterObject(CORBA::Object_ptr theObject);
    @@ -567,7 +562,7 @@ public:
       template
       typename TInterface::_var_type GetObjectByOldId( const int oldID )
       {
    -    if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) {
    +    if ( myStudyContext ) {
           std::string ior = myStudyContext->getIORbyOldId( oldID );
           if ( !ior.empty() )
             return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
    @@ -575,9 +570,6 @@ public:
         return TInterface::_nil();
       }
     
    -  // Get current study ID
    -  int GetCurrentStudyID();
    -
       /*!
        * \brief Find SObject for an algo
        */
    @@ -653,9 +645,6 @@ private:
                                                     const char* theCommandNameForPython,
                                                     const char* theFileNameForPython);
     
    -  void setCurrentStudy( SALOMEDS::Study_ptr theStudy,
    -                        bool                theStudyIsBeingClosed=false);
    -
       std::vector _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
                                    SMESH::ElementType     theElemType,
                                    TopoDS_Shape& aShape,
    @@ -673,11 +662,11 @@ private:
       // hypotheses managing
       std::map myHypCreatorMap;
     
    -  std::map   myStudyContextMap;  // Map of study context objects
    +  StudyContext*                  myStudyContext;  // study context
     
       GEOM_Client*                   myShapeReader;      // Shape reader
    -  SALOMEDS::Study_var            myCurrentStudy;     // Current study
       CORBA::Boolean                 myIsEmbeddedMode;   // Current mode
    +  CORBA::Boolean                 myIsEnablePublish;  // Enable publishing
     
       // Default color of groups
       std::string myDefaultGroupColor;
    @@ -686,11 +675,11 @@ private:
       bool myToForgetMeshDataOnHypModif;
     
       // Dump Python: trace of API methods calls
    -  std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts;
    -  bool                                                     myIsHistoricalPythonDump;
    -  std::vector< int >                                       myLastParamIndex;
    -  std::vector< std::string >                               myLastParameters;
    -  std::string                                              myLastObj;
    +  Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
    +  bool                                   myIsHistoricalPythonDump;
    +  std::vector< int >                     myLastParamIndex;
    +  std::vector< std::string >             myLastParameters;
    +  std::string                            myLastObj;
     };
     
     
    diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx
    index b08b7e3e6..c9b43633c 100644
    --- a/src/SMESH_I/SMESH_Gen_i_1.cxx
    +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx
    @@ -40,6 +40,7 @@
     #include 
     #include 
     #include 
    +#include 
     
     #include 
     #include 
    @@ -162,10 +163,11 @@ long SMESH_Gen_i::GetBallElementsGroupsTag()
     
     bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
     {
    -  if(MYDEBUG) MESSAGE("CanPublishInStudy - "<_is_nil() )
         return true;
    @@ -191,18 +193,26 @@ bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
     //purpose  : Put a result into a SALOMEDS::SObject_wrap or call UnRegister()!
     //=======================================================================
     
    -SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(SALOMEDS::Study_ptr theStudy,
    -                                                   CORBA::Object_ptr   theObject)
    +SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(CORBA::Object_ptr theObject)
     {
       SALOMEDS::SObject_wrap aSO;
    -  if ( !CORBA::is_nil( theStudy ) && !CORBA::is_nil( theObject ))
    +  if ( !CORBA::is_nil( theObject ))
       {
         CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theObject );
    -    aSO = theStudy->FindObjectIOR( objStr.in() );
    +    aSO = getStudyServant()->FindObjectIOR( objStr.in() );
       }
       return aSO._retn();
     }
     
    +//=======================================================================
    +//function : GetStudyPtr
    +//purpose  : Get study from naming service
    +//=======================================================================
    +SALOMEDS::Study_ptr SMESH_Gen_i::getStudyServant()
    +{
    +  return SALOMEDS::Study::_duplicate(KERNEL::getStudyServant());
    +}
    +
     //=======================================================================
     //function : objectToServant
     //purpose  : 
    @@ -255,14 +265,14 @@ TopoDS_Shape SMESH_Gen_i::GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject)
     //purpose  : 
     //=======================================================================
     
    -static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr   theStudy,
    -                                     CORBA::Object_ptr     theIOR,
    +static SALOMEDS::SObject_ptr publish(CORBA::Object_ptr     theIOR,
                                          SALOMEDS::SObject_ptr theFatherObject,
                                          const int             theTag = 0,
                                          const char*           thePixMap = 0,
                                          const bool            theSelectable = true)
     {
    -  SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( theStudy, theIOR );
    +  SALOMEDS::Study_var theStudy = SMESH_Gen_i::getStudyServant();
    +  SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( theIOR );
       SALOMEDS::StudyBuilder_var     aStudyBuilder = theStudy->NewBuilder();
       SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
       bool isNewSO = false, isInUseCaseTree = false;
    @@ -356,8 +366,7 @@ void SMESH_Gen_i::SetName(SALOMEDS::SObject_ptr theSObject,
                               const char*           theDefaultName)
     {
       if ( !theSObject->_is_nil() ) {
    -    SALOMEDS::Study_var               aStudy = theSObject->GetStudy();
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
         SALOMEDS::GenericAttribute_wrap   anAttr =
           aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" );
         SALOMEDS::AttributeName_wrap aNameAttr = anAttr;
    @@ -389,8 +398,7 @@ void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject,
     {
       if ( !theSObject->_is_nil() && thePixMap && strlen( thePixMap ))
       {
    -    SALOMEDS::Study_var               aStudy = theSObject->GetStudy();
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
         SALOMEDS::GenericAttribute_wrap anAttr =
           aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributePixMap" );
         SALOMEDS::AttributePixMap_wrap aPMAttr = anAttr;
    @@ -403,21 +411,21 @@ void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject,
     //purpose  : 
     //=======================================================================
     
    -static void addReference (SALOMEDS::Study_ptr   theStudy,
    -                          SALOMEDS::SObject_ptr theSObject,
    +static void addReference (SALOMEDS::SObject_ptr theSObject,
                               CORBA::Object_ptr     theToObject,
                               int                   theTag = 0)
     {
    -  SALOMEDS::SObject_wrap aToObjSO = SMESH_Gen_i::ObjectToSObject( theStudy, theToObject );
    +  SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
    +  SALOMEDS::SObject_wrap aToObjSO = SMESH_Gen_i::ObjectToSObject( theToObject );
       if ( !aToObjSO->_is_nil() && !theSObject->_is_nil() ) {
    -    SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
    +    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
         SALOMEDS::SObject_wrap aReferenceSO;
         if ( !theTag ) {
           // check if the reference to theToObject already exists
           // and find a free label for the reference object
           bool isReferred = false;
           int tag = 1;
    -      SALOMEDS::ChildIterator_wrap anIter = theStudy->NewChildIterator( theSObject );
    +      SALOMEDS::ChildIterator_wrap anIter = aStudy->NewChildIterator( theSObject );
           for ( ; !isReferred && anIter->More(); anIter->Next(), ++tag ) {
             SALOMEDS::SObject_wrap curSO = anIter->Value();
             if ( curSO->ReferencedObject( aReferenceSO.inout() )) {
    @@ -444,7 +452,7 @@ static void addReference (SALOMEDS::Study_ptr   theStudy,
     
         // add reference to the use case tree
         // (to support tree representation customization and drag-n-drop)
    -    SALOMEDS::UseCaseBuilder_wrap  useCaseBuilder = theStudy->GetUseCaseBuilder();
    +    SALOMEDS::UseCaseBuilder_wrap  useCaseBuilder = aStudy->GetUseCaseBuilder();
         SALOMEDS::UseCaseIterator_wrap    useCaseIter = useCaseBuilder->GetUseCaseIterator(theSObject);
         for ( ; useCaseIter->More(); useCaseIter->Next() )
         {
    @@ -464,42 +472,41 @@ static void addReference (SALOMEDS::Study_ptr   theStudy,
      */
     //=============================================================================
     
    -SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::Study_ptr   theStudy,
    -                                                  SALOMEDS::SObject_ptr theSObject,
    +SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject,
                                                       CORBA::Object_ptr     theIOR,
                                                       const char*           theName)
          throw (SALOME::SALOME_Exception)
     {
       Unexpect aCatch(SALOME_SalomeException);
       SALOMEDS::SObject_wrap aSO;
    -  if ( CORBA::is_nil( theStudy ) || CORBA::is_nil( theIOR ))
    +  if ( CORBA::is_nil( theIOR ))
         return aSO._retn();
       if(MYDEBUG) MESSAGE("PublishInStudy");
     
       // Publishing a mesh
       SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( theIOR );
       if( !aMesh->_is_nil() )
    -    aSO = PublishMesh( theStudy, aMesh, theName );
    +    aSO = PublishMesh( aMesh, theName );
     
       // Publishing a sub-mesh
       SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( theIOR );
       if( aSO->_is_nil() && !aSubMesh->_is_nil() ) {
         GEOM::GEOM_Object_var aShapeObject = aSubMesh->GetSubShape();
         aMesh = aSubMesh->GetFather();
    -    aSO = PublishSubMesh( theStudy, aMesh, aSubMesh, aShapeObject, theName );
    +    aSO = PublishSubMesh( aMesh, aSubMesh, aShapeObject, theName );
       }
     
       // Publishing a hypothesis or algorithm
       SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( theIOR );
       if ( aSO->_is_nil() && !aHyp->_is_nil() )
    -    aSO = PublishHypothesis( theStudy, aHyp );
    +    aSO = PublishHypothesis( aHyp );
     
       // Publishing a group
       SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(theIOR);
       if ( aSO->_is_nil() && !aGroup->_is_nil() ) {
         GEOM::GEOM_Object_var aShapeObject;
         aMesh = aGroup->GetMesh();
    -    aSO = PublishGroup( theStudy, aMesh, aGroup, aShapeObject, theName );
    +    aSO = PublishGroup( aMesh, aGroup, aShapeObject, theName );
       }
       if(MYDEBUG) MESSAGE("PublishInStudy_END");
     
    @@ -511,17 +518,15 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::Study_ptr   theStudy
     //purpose  : 
     //=======================================================================
     
    -SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent(SALOMEDS::Study_ptr theStudy)
    +SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
     {
    -  if ( CORBA::is_nil( theStudy ))
    -    return SALOMEDS::SComponent::_nil();
       if(MYDEBUG) MESSAGE("PublishComponent");
     
    -  SALOMEDS::StudyBuilder_var    aStudyBuilder  = theStudy->NewBuilder(); 
    -  SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
    +  SALOMEDS::StudyBuilder_var    aStudyBuilder  = getStudyServant()->NewBuilder();
    +  SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
     
       CORBA::String_var   compDataType = ComponentDataType();
    -  SALOMEDS::SComponent_wrap father = theStudy->FindComponent( compDataType.in() );
    +  SALOMEDS::SComponent_wrap father = getStudyServant()->FindComponent( compDataType.in() );
       if ( !CORBA::is_nil( father ) ) {
         // check that the component is added to the use case browser
         if ( !useCaseBuilder->IsUseCaseNode( father ) ) {
    @@ -564,21 +569,19 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent(SALOMEDS::Study_ptr theSt
     //purpose  : 
     //=======================================================================
     
    -SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
    -                                                SMESH::SMESH_Mesh_ptr theMesh,
    +SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
                                                     const char*           theName)
     {
    -  if ( CORBA::is_nil( theStudy ) ||
    -       CORBA::is_nil( theMesh ))
    +  if ( CORBA::is_nil( theMesh ))
         return SALOMEDS::SComponent::_nil();
       if(MYDEBUG) MESSAGE("PublishMesh--IN");
     
       // find or publish a mesh
     
    -  SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
    +  SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
       if ( aMeshSO->_is_nil() )
       {
    -    SALOMEDS::SComponent_wrap father = PublishComponent( theStudy );
    +    SALOMEDS::SComponent_wrap father = PublishComponent();
         if ( father->_is_nil() )
           return aMeshSO._retn();
     
    @@ -589,7 +592,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
         else
           aTag++;
     
    -    aMeshSO = publish (theStudy, theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
    +    aMeshSO = publish ( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
         if ( aMeshSO->_is_nil() )
           return aMeshSO._retn();
       }
    @@ -599,7 +602,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
     
       GEOM::GEOM_Object_var aShapeObject = theMesh->GetShapeToMesh();
       if ( !CORBA::is_nil( aShapeObject )) {
    -    addReference( theStudy, aMeshSO, aShapeObject, GetRefOnShapeTag() );
    +    addReference( aMeshSO, aShapeObject, GetRefOnShapeTag() );
     
         // Publish global hypotheses
     
    @@ -607,8 +610,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
         for ( CORBA::ULong i = 0; i < hypList->length(); i++ )
         {
           SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]);
    -      SALOMEDS::SObject_wrap so = PublishHypothesis( theStudy, aHyp );
    -      AddHypothesisToShape( theStudy, theMesh, aShapeObject, aHyp );
    +      SALOMEDS::SObject_wrap so = PublishHypothesis( aHyp );
    +      AddHypothesisToShape( theMesh, aShapeObject, aHyp );
         }
       }
     
    @@ -623,7 +626,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
         SMESH::SMESH_subMesh_ptr aSubMesh = (*subIt).second->_this();
         if ( !CORBA::is_nil( aSubMesh )) {
           aShapeObject = aSubMesh->GetSubShape();
    -      SALOMEDS::SObject_wrap( PublishSubMesh( theStudy, theMesh, aSubMesh, aShapeObject ));
    +      SALOMEDS::SObject_wrap( PublishSubMesh( theMesh, aSubMesh, aShapeObject ));
         }
       }
     
    @@ -638,7 +641,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
           SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup );
           if ( !aGeomGroup->_is_nil() )
             aShapeObj = aGeomGroup->GetShape();
    -      SALOMEDS::SObject_wrap( PublishGroup( theStudy, theMesh, aGroup, aShapeObj ));
    +      SALOMEDS::SObject_wrap( PublishGroup( theMesh, aGroup, aShapeObj ));
         }
       }
     
    @@ -651,22 +654,20 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr   theStudy,
     //purpose  : 
     //=======================================================================
     
    -SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theStudy,
    -                                                   SMESH::SMESH_Mesh_ptr    theMesh,
    +SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SMESH::SMESH_Mesh_ptr    theMesh,
                                                        SMESH::SMESH_subMesh_ptr theSubMesh,
                                                        GEOM::GEOM_Object_ptr    theShapeObject,
                                                        const char*              theName)
     {
    -  if (theStudy->_is_nil() || theMesh->_is_nil() ||
    -      theSubMesh->_is_nil() || theShapeObject->_is_nil() )
    +  if ( theMesh->_is_nil() || theSubMesh->_is_nil() || theShapeObject->_is_nil() )
         return SALOMEDS::SObject::_nil();
     
    -  SALOMEDS::SObject_wrap aSubMeshSO = ObjectToSObject( theStudy, theSubMesh );
    +  SALOMEDS::SObject_wrap aSubMeshSO = ObjectToSObject( theSubMesh );
       if ( aSubMeshSO->_is_nil() )
       {
    -    SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
    +    SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
         if ( aMeshSO->_is_nil() ) {
    -      aMeshSO = PublishMesh( theStudy, theMesh );
    +      aMeshSO = PublishMesh( theMesh );
           if ( aMeshSO->_is_nil())
             return SALOMEDS::SObject::_nil();
         }
    @@ -705,8 +706,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
         }
     
         // Find or create submesh root
    -    SALOMEDS::SObject_wrap aRootSO = publish (theStudy, CORBA::Object::_nil(),
    -                                             aMeshSO, aRootTag, 0, false );
    +    SALOMEDS::SObject_wrap aRootSO = publish ( CORBA::Object::_nil(),
    +                                               aMeshSO, aRootTag, 0, false );
         if ( aRootSO->_is_nil() )
           return aSubMeshSO._retn();
     
    @@ -716,7 +717,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
         SMESH::array_of_ElementType_var elemTypes = theSubMesh->GetTypes();
         const int isEmpty = ( elemTypes->length() == 0 );
         const char* pm[2] = { "ICON_SMESH_TREE_MESH", "ICON_SMESH_TREE_MESH_WARN" };
    -    aSubMeshSO = publish (theStudy, theSubMesh, aRootSO, 0, pm[isEmpty] );
    +    aSubMeshSO = publish ( theSubMesh, aRootSO, 0, pm[isEmpty] );
         if ( aSubMeshSO->_is_nil() )
           return aSubMeshSO._retn();
       }
    @@ -724,15 +725,15 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
     
       // Add reference to theShapeObject
     
    -  addReference( theStudy, aSubMeshSO, theShapeObject, 1 );
    +  addReference( aSubMeshSO, theShapeObject, 1 );
     
       // Publish hypothesis
     
       SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( theShapeObject );
       for ( CORBA::ULong i = 0; i < hypList->length(); i++ ) {
         SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]);
    -    SALOMEDS::SObject_wrap so = PublishHypothesis( theStudy, aHyp );
    -    AddHypothesisToShape( theStudy, theMesh, theShapeObject, aHyp );
    +    SALOMEDS::SObject_wrap so = PublishHypothesis( aHyp );
    +    AddHypothesisToShape( theMesh, theShapeObject, aHyp );
       }
     
       return aSubMeshSO._retn();
    @@ -743,21 +744,20 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
     //purpose  : 
     //=======================================================================
     
    -SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy,
    -                                                 SMESH::SMESH_Mesh_ptr  theMesh,
    +SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SMESH::SMESH_Mesh_ptr  theMesh,
                                                      SMESH::SMESH_GroupBase_ptr theGroup,
                                                      GEOM::GEOM_Object_ptr  theShapeObject,
                                                      const char*            theName)
     {
    -  if (theStudy->_is_nil() || theMesh->_is_nil() || theGroup->_is_nil() )
    +  if (theMesh->_is_nil() || theGroup->_is_nil() )
         return SALOMEDS::SObject::_nil();
     
    -  SALOMEDS::SObject_wrap aGroupSO = ObjectToSObject( theStudy, theGroup );
    +  SALOMEDS::SObject_wrap aGroupSO = ObjectToSObject( theGroup );
       if ( aGroupSO->_is_nil() )
       {
    -    SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
    +    SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
         if ( aMeshSO->_is_nil() ) {
    -      aMeshSO = PublishInStudy( theStudy, SALOMEDS::SObject::_nil(), theMesh, "");
    +      aMeshSO = PublishInStudy( SALOMEDS::SObject::_nil(), theMesh, "");
           if ( aMeshSO->_is_nil())
             return SALOMEDS::SObject::_nil();
         }
    @@ -773,8 +773,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
           long aRootTag = GetNodeGroupsTag() + aType - 1;
     
           // Find or create groups root
    -      SALOMEDS::SObject_wrap aRootSO = publish (theStudy, CORBA::Object::_nil(),
    -                                               aMeshSO, aRootTag, 0, false );
    +      SALOMEDS::SObject_wrap aRootSO = publish ( CORBA::Object::_nil(),
    +                                                 aMeshSO, aRootTag, 0, false );
           if ( aRootSO->_is_nil() ) return SALOMEDS::SObject::_nil();
     
           if ( aType < sizeof(aRootNames)/sizeof(char*) )
    @@ -798,7 +798,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
                 isEmpty = ( allElemTypes[i] != theGroup->GetType() );
             }
           }
    -      aGroupSO = publish (theStudy, theGroup, aRootSO, 0, pm[isEmpty].c_str() );
    +      aGroupSO = publish ( theGroup, aRootSO, 0, pm[isEmpty].c_str() );
         }
         if ( aGroupSO->_is_nil() )
           return aGroupSO._retn();
    @@ -808,7 +808,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
     
       //Add reference to geometry
       if ( !theShapeObject->_is_nil() )
    -    addReference( theStudy, aGroupSO, theShapeObject, 1 );
    +    addReference( aGroupSO, theShapeObject, 1 );
     
       return aGroupSO._retn();
     }
    @@ -819,20 +819,19 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
     //=======================================================================
     
     SALOMEDS::SObject_ptr
    -  SMESH_Gen_i::PublishHypothesis (SALOMEDS::Study_ptr         theStudy,
    -                                  SMESH::SMESH_Hypothesis_ptr theHyp,
    +  SMESH_Gen_i::PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
                                       const char*                 theName)
     {
       if(MYDEBUG) MESSAGE("PublishHypothesis")
    -  if (theStudy->_is_nil() || theHyp->_is_nil())
    +  if (theHyp->_is_nil())
         return SALOMEDS::SObject::_nil();
     
       CORBA::String_var hypType = theHyp->GetName();
     
    -  SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theStudy, theHyp );
    +  SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theHyp );
       if ( aHypSO->_is_nil() )
       {
    -    SALOMEDS::SComponent_wrap father = PublishComponent( theStudy );
    +    SALOMEDS::SComponent_wrap father = PublishComponent();
         if ( father->_is_nil() )
           return aHypSO._retn();
     
    @@ -840,7 +839,7 @@ SALOMEDS::SObject_ptr
         bool isAlgo = ( !SMESH::SMESH_Algo::_narrow( theHyp )->_is_nil() );
         int aRootTag = isAlgo ? GetAlgorithmsRootTag() : GetHypothesisRootTag();
         SALOMEDS::SObject_wrap aRootSO =
    -      publish (theStudy, CORBA::Object::_nil(),father, aRootTag,
    +      publish (CORBA::Object::_nil(),father, aRootTag,
                    isAlgo ? "ICON_SMESH_TREE_ALGO" : "ICON_SMESH_TREE_HYPO", false);
         SetName( aRootSO, isAlgo ?  "Algorithms" : "Hypotheses" );
     
    @@ -851,7 +850,7 @@ SALOMEDS::SObject_ptr
         string pluginName = myHypCreatorMap[ hypType.in() ]->GetModuleName();
         if ( pluginName != "StdMeshers" )
           aPmName = pluginName + "::" + aPmName;
    -    aHypSO = publish( theStudy, theHyp, aRootSO, 0, aPmName.c_str() );
    +    aHypSO = publish( theHyp, aRootSO, 0, aPmName.c_str() );
       }
     
       SetName( aHypSO, theName, hypType.in() );
    @@ -866,8 +865,7 @@ SALOMEDS::SObject_ptr
     //=======================================================================
     
     SALOMEDS::SObject_ptr
    -  SMESH_Gen_i::GetMeshOrSubmeshByShape (SALOMEDS::Study_ptr   theStudy,
    -                                        SMESH::SMESH_Mesh_ptr theMesh,
    +  SMESH_Gen_i::GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
                                             GEOM::GEOM_Object_ptr theShape)
     {
       if(MYDEBUG) MESSAGE("GetMeshOrSubmeshByShape")
    @@ -886,12 +884,12 @@ SALOMEDS::SObject_ptr
       if ( !aShape.IsNull() && mesh_i && mesh_i->GetImpl().GetMeshDS() ) {
         SMESHDS_Mesh* meshDS = mesh_i->GetImpl().GetMeshDS();
         if ( aShape.IsSame( meshDS->ShapeToMesh() ))
    -      aMeshOrSubMesh = ObjectToSObject( theStudy, theMesh );
    +      aMeshOrSubMesh = ObjectToSObject( theMesh );
         else {
           int shapeID = meshDS->ShapeToIndex( aShape );
           SMESH::SMESH_subMesh_var aSubMesh = mesh_i->getSubMesh(shapeID);
           if ( !aSubMesh->_is_nil() )
    -        aMeshOrSubMesh = ObjectToSObject( theStudy, aSubMesh );
    +        aMeshOrSubMesh = ObjectToSObject( aSubMesh );
         }
       }
       if(MYDEBUG) MESSAGE("GetMeshOrSubmeshByShape--END")
    @@ -903,27 +901,26 @@ SALOMEDS::SObject_ptr
     //purpose  : 
     //=======================================================================
     
    -bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
    -                                       SMESH::SMESH_Mesh_ptr       theMesh,
    +bool SMESH_Gen_i::AddHypothesisToShape(SMESH::SMESH_Mesh_ptr       theMesh,
                                            GEOM::GEOM_Object_ptr       theShape,
                                            SMESH::SMESH_Hypothesis_ptr theHyp)
     {
       if(MYDEBUG) MESSAGE("AddHypothesisToShape")
    -  if (theStudy->_is_nil() || theMesh->_is_nil() ||
    +  if (theMesh->_is_nil() ||
           theHyp->_is_nil() || (theShape->_is_nil()
                                 && theMesh->HasShapeToMesh()) )
         return false;
     
    -  SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
    +  SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
       if ( aMeshSO->_is_nil() )
    -    aMeshSO = PublishMesh( theStudy, theMesh );
    -  SALOMEDS::SObject_wrap aHypSO = PublishHypothesis( theStudy, theHyp );
    +    aMeshSO = PublishMesh( theMesh );
    +  SALOMEDS::SObject_wrap aHypSO = PublishHypothesis( theHyp );
       if ( aMeshSO->_is_nil() || aHypSO->_is_nil())
         return false;
     
       // Find a mesh or submesh referring to theShape
       SALOMEDS::SObject_wrap aMeshOrSubMesh =
    -    GetMeshOrSubmeshByShape( theStudy, theMesh, theShape );
    +    GetMeshOrSubmeshByShape( theMesh, theShape );
       if ( aMeshOrSubMesh->_is_nil() )
       {
         // publish submesh
    @@ -933,7 +930,7 @@ bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
           SMESHDS_Mesh* meshDS = mesh_i->GetImpl().GetMeshDS();
           int shapeID = meshDS->ShapeToIndex( aShape );
           SMESH::SMESH_subMesh_var aSubMesh = mesh_i->getSubMesh(shapeID);
    -      aMeshOrSubMesh = PublishSubMesh( theStudy, theMesh, aSubMesh, theShape );
    +      aMeshOrSubMesh = PublishSubMesh( theMesh, aSubMesh, theShape );
         }
         if ( aMeshOrSubMesh->_is_nil() )
           return false;
    @@ -942,12 +939,12 @@ bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
       //Find or Create Applied Hypothesis root
       bool aIsAlgo = !SMESH::SMESH_Algo::_narrow( theHyp )->_is_nil();
       SALOMEDS::SObject_wrap AHR =
    -    publish (theStudy, CORBA::Object::_nil(), aMeshOrSubMesh,
    +    publish (CORBA::Object::_nil(), aMeshOrSubMesh,
                  aIsAlgo ? GetRefOnAppliedAlgorithmsTag() : GetRefOnAppliedHypothesisTag(),
                  aIsAlgo ? "ICON_SMESH_TREE_ALGO" : "ICON_SMESH_TREE_HYPO", false);
       SetName( AHR, aIsAlgo ? "Applied algorithms" : "Applied hypotheses" );
     
    -  addReference( theStudy, AHR, theHyp );
    +  addReference( AHR, theHyp );
     
       if(MYDEBUG) MESSAGE("AddHypothesisToShape--END")
       return true;
    @@ -958,17 +955,16 @@ bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr         theStudy,
     //purpose  : 
     //=======================================================================
     
    -bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy,
    -                                            SMESH::SMESH_Mesh_ptr       theMesh,
    +bool SMESH_Gen_i::RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr       theMesh,
                                                 GEOM::GEOM_Object_ptr       theShape,
                                                 SMESH::SMESH_Hypothesis_ptr theHyp)
     {
    -  if (theStudy->_is_nil() || theMesh->_is_nil() ||
    +  if (theMesh->_is_nil() ||
           theHyp->_is_nil() || (theShape->_is_nil()
                                 && theMesh->HasShapeToMesh()))
         return false;
     
    -  SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theStudy, theHyp );
    +  SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theHyp );
       if ( aHypSO->_is_nil() )
         return false;
     
    @@ -976,13 +972,13 @@ bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy
     
       // Find a mesh or sub-mesh referring to theShape
       SALOMEDS::SObject_wrap aMeshOrSubMesh =
    -    GetMeshOrSubmeshByShape( theStudy, theMesh, theShape );
    +    GetMeshOrSubmeshByShape( theMesh, theShape );
       if ( aMeshOrSubMesh->_is_nil() )
         return false;
     
       // Find and remove a reference to aHypSO
       SALOMEDS::SObject_wrap aRef, anObj;
    -  SALOMEDS::ChildIterator_wrap it = theStudy->NewChildIterator( aMeshOrSubMesh );
    +  SALOMEDS::ChildIterator_wrap it = getStudyServant()->NewChildIterator( aMeshOrSubMesh );
       bool found = false;
       for ( it->InitEx( true ); ( it->More() && !found ); it->Next() ) {
         anObj = it->Value();
    @@ -993,7 +989,7 @@ bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy
         }
         if ( found )
         {
    -      SALOMEDS::StudyBuilder_var builder = theStudy->NewBuilder();
    +      SALOMEDS::StudyBuilder_var builder = getStudyServant()->NewBuilder();
           builder->RemoveObject( anObj );
         }
       }
    @@ -1012,10 +1008,6 @@ bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy
     
     void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters)
     {
    -  SALOMEDS::Study_var aStudy = GetCurrentStudy();
    -  if ( aStudy->_is_nil() )
    -    return;
    -
       // find variable names within theParameters
     
       myLastObj.clear();
    @@ -1032,7 +1024,7 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
           if ( prevPos < pos )
           {
             string val( theParameters + prevPos, theParameters + pos );
    -        if ( !aStudy->IsVariable( val.c_str() ))
    +        if ( !getStudyServant()->IsVariable( val.c_str() ))
               val.clear();
             myLastParameters.push_back( val );
             nbVars += (! myLastParameters.back().empty() );
    @@ -1054,14 +1046,14 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
       // (2) indices of found variables in myLastParamIndex.
     
       // remember theObject
    -  SALOMEDS::SObject_wrap aSObj =  ObjectToSObject(aStudy,theObject);
    +  SALOMEDS::SObject_wrap aSObj =  ObjectToSObject(theObject);
       if ( aSObj->_is_nil() )
         return;
       CORBA::String_var anObjEntry = aSObj->GetID();
       myLastObj = anObjEntry.in();
     
       // get a string of variable names
    -  SALOMEDS::StudyBuilder_var   aStudyBuilder = aStudy->NewBuilder();
    +  SALOMEDS::StudyBuilder_var   aStudyBuilder = getStudyServant()->NewBuilder();
       SALOMEDS::GenericAttribute_wrap     anAttr =
         aStudyBuilder->FindOrCreateAttribute( aSObj, "AttributeString" );
       SALOMEDS::AttributeString_wrap aStringAttr = anAttr;
    @@ -1130,15 +1122,11 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
     std::vector< std::string > SMESH_Gen_i::GetAllParameters(const std::string& theObjectEntry) const
     {
       std::vector< std::string > varNames;
    -  if ( myCurrentStudy->_is_nil() )
    -    return varNames;
     
    -  SALOMEDS::SObject_wrap aSObj = myCurrentStudy->FindObjectID( theObjectEntry.c_str() );
    -  if ( myCurrentStudy->_is_nil() )
    -    return varNames;
    +  SALOMEDS::SObject_wrap aSObj = getStudyServant()->FindObjectID( theObjectEntry.c_str() );
     
       // get a string of variable names
    -  SALOMEDS::StudyBuilder_var   aStudyBuilder = myCurrentStudy->NewBuilder();
    +  SALOMEDS::StudyBuilder_var   aStudyBuilder = getStudyServant()->NewBuilder();
       SALOMEDS::GenericAttribute_wrap     anAttr =
         aStudyBuilder->FindOrCreateAttribute( aSObj, "AttributeString" );
       SALOMEDS::AttributeString_wrap aStringAttr = anAttr;
    @@ -1183,7 +1171,7 @@ std::vector< std::string > SMESH_Gen_i::GetAllParameters(const std::string& theO
     //   //const char* aParameters = theParameters;
     // //   const char* aParameters = CORBA::string_dup(theParameters);
     //   TCollection_AsciiString anInputParams;
    -//   SALOMEDS::Study_var aStudy = GetCurrentStudy();
    +//   SALOMEDS::Study_var aStudy = getStudyServant();
     //   if( !aStudy->_is_nil() ) {
     // //     SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(theParameters);
     // //     for(int j=0;jlength();j++) {
    @@ -1232,7 +1220,7 @@ char* SMESH_Gen_i::GetParameters(CORBA::Object_ptr theObject)
     {
       CORBA::String_var aResult("");
     
    -  SALOMEDS::SObject_wrap aSObj = ObjectToSObject( myCurrentStudy, theObject );
    +  SALOMEDS::SObject_wrap aSObj = ObjectToSObject( theObject );
       if ( !aSObj->_is_nil() )
       {
         SALOMEDS::GenericAttribute_wrap attr;
    diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx
    index d9c4b0961..ef9ad7760 100644
    --- a/src/SMESH_I/SMESH_Group_i.cxx
    +++ b/src/SMESH_I/SMESH_Group_i.cxx
    @@ -150,9 +150,8 @@ void SMESH_GroupBase_i::SetName( const char* theName )
     
       // Update group name in a study
       SMESH_Gen_i*              aGen = myMeshServant->GetGen();
    -  SALOMEDS::Study_var      aStudy = aGen->GetCurrentStudy();
       SMESH::SMESH_GroupBase_var aGrp = _this();
    -  SALOMEDS::SObject_var      anSO = aGen->ObjectToSObject( aStudy, aGrp );
    +  SALOMEDS::SObject_var      anSO = aGen->ObjectToSObject( aGrp );
       if ( !anSO->_is_nil() )
       {
         aGen->SetName( anSO, theName );
    diff --git a/src/SMESH_I/SMESH_Hypothesis_i.cxx b/src/SMESH_I/SMESH_Hypothesis_i.cxx
    index b3e4e4832..9b9779d68 100644
    --- a/src/SMESH_I/SMESH_Hypothesis_i.cxx
    +++ b/src/SMESH_I/SMESH_Hypothesis_i.cxx
    @@ -128,8 +128,7 @@ bool SMESH_Hypothesis_i::IsPublished()
       bool res = false;
       if ( SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen())
       {
    -    SALOMEDS::Study_var study = gen->GetCurrentStudy();
    -    SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( study, _this());
    +    SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( _this());
         res = !SO->_is_nil();
       }
       return res;
    diff --git a/src/SMESH_I/SMESH_Hypothesis_i.hxx b/src/SMESH_I/SMESH_Hypothesis_i.hxx
    index 85f1d0196..ee8baec36 100644
    --- a/src/SMESH_I/SMESH_Hypothesis_i.hxx
    +++ b/src/SMESH_I/SMESH_Hypothesis_i.hxx
    @@ -133,7 +133,6 @@ class SMESH_I_EXPORT GenericHypothesisCreator_i
     public:
       // Create a hypothesis
       virtual SMESH_Hypothesis_i* Create(PortableServer::POA_ptr thePOA,
    -                                     int                     theStudyId,
                                          ::SMESH_Gen*            theGenImpl) = 0;
       virtual ~GenericHypothesisCreator_i() {}
     
    @@ -153,10 +152,9 @@ template  class HypothesisCreator_i: public GenericHypothesisCreator_i
     {
     public:
       virtual SMESH_Hypothesis_i* Create (PortableServer::POA_ptr thePOA,
    -                                      int                     theStudyId,
                                           ::SMESH_Gen*            theGenImpl)
       {
    -    return new T (thePOA, theStudyId, theGenImpl);
    +    return new T (thePOA, theGenImpl);
       };
     };
     
    diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx
    index 0ba74d70f..7cbef4f10 100644
    --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx
    +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx
    @@ -110,7 +110,7 @@ namespace MeshEditor_I {
         SMDSAbs_ElementType myPreviewType; // type to show
         //!< Constructor
         TPreviewMesh(SMDSAbs_ElementType previewElements = SMDSAbs_All) {
    -      _isShapeToMesh = (_id =_studyId = 0);
    +      _isShapeToMesh = (_id = 0);
           _myMeshDS  = new SMESHDS_Mesh( _id, true );
           myPreviewType = previewElements;
         }
    @@ -5269,8 +5269,7 @@ SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::makeMesh(const char* theMeshName)
     {
       SMESH_Gen_i*              gen = SMESH_Gen_i::GetSMESHGen();
       SMESH::SMESH_Mesh_var    mesh = gen->CreateEmptyMesh();
    -  SALOMEDS::Study_var     study = gen->GetCurrentStudy();
    -  SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( study, mesh );
    +  SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( mesh );
       gen->SetName( meshSO, theMeshName, "Mesh" );
       gen->SetPixMap( meshSO, "ICON_SMESH_TREE_MESH_IMPORTED");
     
    diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx
    index 268dfd829..d030cbc93 100644
    --- a/src/SMESH_I/SMESH_Mesh_i.cxx
    +++ b/src/SMESH_I/SMESH_Mesh_i.cxx
    @@ -104,14 +104,12 @@ int SMESH_Mesh_i::_idGenerator = 0;
     //=============================================================================
     
     SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
    -                            SMESH_Gen_i*            gen_i,
    -                            CORBA::Long             studyId )
    +                            SMESH_Gen_i*            gen_i )
     : SALOME::GenericObj_i( thePOA )
     {
       _impl          = NULL;
       _gen_i         = gen_i;
       _id            = _idGenerator++;
    -  _studyId       = studyId;
       _editor        = NULL;
       _previewEditor = NULL;
       _preMeshInfo   = NULL;
    @@ -239,9 +237,7 @@ GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh()
             for ( ; data != _geomGroupData.end(); ++data )
               if ( data->_smeshObject->_is_equivalent( _this() ))
               {
    -            SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -            if ( study->_is_nil() ) break;
    -            SALOMEDS::SObject_wrap so = study->FindObjectID( data->_groupEntry.c_str() );
    +            SALOMEDS::SObject_wrap so = SMESH_Gen_i::getStudyServant()->FindObjectID( data->_groupEntry.c_str() );
                 CORBA::Object_var     obj = _gen_i->SObjectToObject( so );
                 aShapeObj = GEOM::GEOM_Object::_narrow( obj );
                 break;
    @@ -499,8 +495,7 @@ int SMESH_Mesh_i::ImportSTLFile( const char* theFileName )
       std::string name = _impl->STLToMesh( theFileName );
       if ( !name.empty() )
       {
    -    SALOMEDS::Study_var     study = _gen_i->GetCurrentStudy();
    -    SALOMEDS::SObject_wrap meshSO = _gen_i->ObjectToSObject( study, _this() );
    +    SALOMEDS::SObject_wrap meshSO = _gen_i->ObjectToSObject( _this() );
         _gen_i->SetName( meshSO, name.c_str() );
       }
     
    @@ -609,8 +604,7 @@ SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Object_ptr       aSubShape,
       SMESH::SMESH_Mesh_var mesh( _this() );
       if ( !SMESH_Hypothesis::IsStatusFatal(status) )
       {
    -    SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -    _gen_i->AddHypothesisToShape( study, mesh, aSubShape, anHyp );
    +    _gen_i->AddHypothesisToShape( mesh, aSubShape, anHyp );
       }
       if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status );
     
    @@ -695,8 +689,7 @@ SMESH::Hypothesis_Status SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Object_ptr aS
     
       if ( !SMESH_Hypothesis::IsStatusFatal(status) )
       {
    -    SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -    _gen_i->RemoveHypothesisFromShape( study, mesh, aSubShape, anHyp );
    +    _gen_i->RemoveHypothesisFromShape( mesh, aSubShape, anHyp );
       }
       // Update Python script
       if(_impl->HasShapeToMesh())
    @@ -866,9 +859,8 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShap
           subMesh = createSubMesh( aSubShape );
         if ( _gen_i->CanPublishInStudy( subMesh ))
         {
    -      SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
           SALOMEDS::SObject_wrap aSO =
    -        _gen_i->PublishSubMesh( study, aMesh, subMesh, aSubShape, theName );
    +        _gen_i->PublishSubMesh( aMesh, subMesh, aSubShape, theName );
           if ( !aSO->_is_nil()) {
             // Update Python script
             TPythonDump() << aSO << " = " << aMesh << ".GetSubMesh( "
    @@ -897,28 +889,25 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
         return;
     
       GEOM::GEOM_Object_var aSubShape;
    -  SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
    -  if ( !aStudy->_is_nil() )  {
    -    // Remove submesh's SObject
    -    SALOMEDS::SObject_wrap anSO = _gen_i->ObjectToSObject( aStudy, theSubMesh );
    -    if ( !anSO->_is_nil() ) {
    -      long aTag = SMESH_Gen_i::GetRefOnShapeTag();
    -      SALOMEDS::SObject_wrap anObj, aRef;
    -      if ( anSO->FindSubObject( aTag, anObj.inout() ) &&
    -           anObj->ReferencedObject( aRef.inout() ))
    -      {
    -        CORBA::Object_var obj = aRef->GetObject();
    -        aSubShape = GEOM::GEOM_Object::_narrow( obj );
    -      }
    -      // if ( aSubShape->_is_nil() ) // not published shape (IPAL13617)
    -      //   aSubShape = theSubMesh->GetSubShape();
    -
    -      SALOMEDS::StudyBuilder_var builder = aStudy->NewBuilder();
    -      builder->RemoveObjectWithChildren( anSO );
    -
    -      // Update Python script
    -      TPythonDump() << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )";
    +  // Remove submesh's SObject
    +  SALOMEDS::SObject_wrap anSO = _gen_i->ObjectToSObject( theSubMesh );
    +  if ( !anSO->_is_nil() ) {
    +    long aTag = SMESH_Gen_i::GetRefOnShapeTag();
    +    SALOMEDS::SObject_wrap anObj, aRef;
    +    if ( anSO->FindSubObject( aTag, anObj.inout() ) &&
    +         anObj->ReferencedObject( aRef.inout() ))
    +    {
    +      CORBA::Object_var obj = aRef->GetObject();
    +      aSubShape = GEOM::GEOM_Object::_narrow( obj );
         }
    +    // if ( aSubShape->_is_nil() ) // not published shape (IPAL13617)
    +    //   aSubShape = theSubMesh->GetSubShape();
    +
    +    SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
    +    builder->RemoveObjectWithChildren( anSO );
    +
    +    // Update Python script
    +    TPythonDump() << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )";
       }
     
       if ( removeSubMesh( theSubMesh, aSubShape.in() ))
    @@ -948,9 +937,8 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup( SMESH::ElementType theElemType
       if ( _gen_i->CanPublishInStudy( aNewGroup ) )
       {
         SMESH::SMESH_Mesh_var mesh = _this();
    -    SALOMEDS::Study_var  study = _gen_i->GetCurrentStudy();
         SALOMEDS::SObject_wrap aSO =
    -      _gen_i->PublishGroup( study, mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName);
    +      _gen_i->PublishGroup( mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName);
         if ( !aSO->_is_nil())
           // Update Python script
           TPythonDump() << aSO << " = " << mesh << ".CreateGroup( "
    @@ -985,9 +973,8 @@ SMESH_Mesh_i::CreateGroupFromGEOM (SMESH::ElementType    theElemType,
         if ( _gen_i->CanPublishInStudy( aNewGroup ) )
         {
           SMESH::SMESH_Mesh_var mesh = _this();
    -      SALOMEDS::Study_var  study = _gen_i->GetCurrentStudy();
           SALOMEDS::SObject_wrap aSO =
    -        _gen_i->PublishGroup( study, mesh, aNewGroup, theGeomObj, theName );
    +        _gen_i->PublishGroup( mesh, aNewGroup, theGeomObj, theName );
           if ( !aSO->_is_nil())
             TPythonDump() << aSO << " = " << mesh << ".CreateGroupFromGEOM( "
                           << theElemType << ", '" << theName << "', " << theGeomObj << " )";
    @@ -1034,9 +1021,8 @@ SMESH_Mesh_i::CreateGroupFromFilter(SMESH::ElementType theElemType,
       if ( _gen_i->CanPublishInStudy( aNewGroup ) )
       {
         SMESH::SMESH_Mesh_var mesh = _this();
    -    SALOMEDS::Study_var  study = _gen_i->GetCurrentStudy();
         SALOMEDS::SObject_wrap aSO =
    -      _gen_i->PublishGroup( study, mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName );
    +      _gen_i->PublishGroup( mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName );
     
         if ( !aSO->_is_nil())
           pd << aSO << " = " << mesh << ".CreateGroupFromFilter( "
    @@ -1063,19 +1049,15 @@ void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup )
       if ( !aGroup )
         return;
     
    -  SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
    -  if ( !aStudy->_is_nil() )
    +  SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( theGroup );
    +  if ( !aGroupSO->_is_nil() )
       {
    -    SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup );
    -    if ( !aGroupSO->_is_nil() )
    -    {
    -      // Update Python script
    -      TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )";
    +    // Update Python script
    +    TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )";
     
    -      // Remove group's SObject
    -      SALOMEDS::StudyBuilder_var builder = aStudy->NewBuilder();
    -      builder->RemoveObjectWithChildren( aGroupSO );
    -    }
    +    // Remove group's SObject
    +    SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
    +    builder->RemoveObjectWithChildren( aGroupSO );
       }
       aGroup->Modified(/*removed=*/true); // notify dependent Filter with FT_BelongToMeshGroup criterion
     
    @@ -1836,14 +1818,13 @@ void SMESH_Mesh_i::addGeomGroupData(GEOM::GEOM_Object_ptr theGeomObj,
       if ( CORBA::is_nil( theGeomObj ) || theGeomObj->GetType() != GEOM_GROUP )
         return;
       // group SO
    -  SALOMEDS::Study_var    study   = _gen_i->GetCurrentStudy();
    -  SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( study, theGeomObj );
    +  SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( theGeomObj );
       if ( groupSO->_is_nil() )
         return;
       // group indices
       GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
       GEOM::GEOM_IGroupOperations_wrap groupOp =
    -    geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
    +    geomGen->GetIGroupOperations();
       GEOM::ListOfLong_var ids = groupOp->GetObjects( theGeomObj );
     
       // store data
    @@ -1891,9 +1872,7 @@ TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData)
       TopoDS_Shape newShape;
     
       // get geom group
    -  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -  if ( study->_is_nil() ) return newShape; // means "not changed"
    -  SALOMEDS::SObject_wrap groupSO = study->FindObjectID( groupData._groupEntry.c_str() );
    +  SALOMEDS::SObject_wrap groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( groupData._groupEntry.c_str() );
       if ( !groupSO->_is_nil() )
       {
         CORBA::Object_var groupObj = _gen_i->SObjectToObject( groupSO );
    @@ -1904,7 +1883,7 @@ TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData)
         set curIndices;
         GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
         GEOM::GEOM_IGroupOperations_wrap groupOp =
    -      geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
    +      geomGen->GetIGroupOperations();
         GEOM::ListOfLong_var   ids = groupOp->GetObjects( geomGroup );
         for ( CORBA::ULong i = 0; i < ids->length(); ++i )
           curIndices.insert( ids[i] );
    @@ -1969,9 +1948,6 @@ void SMESH_Mesh_i::CheckGeomModif()
     {
       if ( !_impl->HasShapeToMesh() ) return;
     
    -  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -  if ( study->_is_nil() ) return;
    -
       GEOM::GEOM_Object_var mainGO = _gen_i->ShapeToGeomObject( _impl->GetShapeToMesh() );
       //if ( mainGO->_is_nil() ) return;
     
    @@ -2118,9 +2094,6 @@ void SMESH_Mesh_i::CheckGeomGroupModif()
     {
       if ( !_impl->HasShapeToMesh() ) return;
     
    -  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -  if ( study->_is_nil() ) return;
    -
       CORBA::Long nbEntities = NbNodes() + NbElements();
     
       // Check if group contents changed
    @@ -2307,7 +2280,7 @@ void SMESH_Mesh_i::CheckGeomGroupModif()
             if ( _mapGroups.find( oldID ) == _mapGroups.end() )
               continue;
             // get group name
    -        SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( study,_mapGroups[oldID] );
    +        SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( _mapGroups[oldID] );
             CORBA::String_var      name    = groupSO->GetName();
             // update
             SMESH_GroupBase_i*  group_i    = SMESH::DownCast(_mapGroups[oldID] );
    @@ -2328,15 +2301,15 @@ void SMESH_Mesh_i::CheckGeomGroupModif()
       if ( newNbEntities != nbEntities )
       {
         // Add all SObjects with icons to soToUpdateIcons
    -    soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, _this() )); // mesh
    +    soToUpdateIcons.push_back( _gen_i->ObjectToSObject( _this() )); // mesh
     
         for (map::iterator i_sm = _mapSubMeshIor.begin();
              i_sm != _mapSubMeshIor.end(); ++i_sm ) // submeshes
    -      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, i_sm->second ));
    +      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( i_sm->second ));
     
         for ( map::iterator i_gr = _mapGroups.begin();
               i_gr != _mapGroups.end(); ++i_gr ) // groups
    -      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, i_gr->second ));
    +      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( i_gr->second ));
       }
     
       list< SALOMEDS::SObject_wrap >::iterator so = soToUpdateIcons.begin();
    @@ -2382,10 +2355,10 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase
     
       SALOMEDS::StudyBuilder_var builder;
       SALOMEDS::SObject_wrap     aGroupSO;
    -  SALOMEDS::Study_var        aStudy = _gen_i->GetCurrentStudy();
    +  SALOMEDS::Study_var        aStudy = SMESH_Gen_i::getStudyServant();
       if ( !aStudy->_is_nil() ) {
         builder  = aStudy->NewBuilder();
    -    aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup );
    +    aGroupSO = _gen_i->ObjectToSObject( theGroup );
         if ( !aGroupSO->_is_nil() )
         {
           // remove reference to geometry
    @@ -2706,17 +2679,6 @@ CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception)
       return _id;
     }
     
    -//=============================================================================
    -/*!
    - *
    - */
    -//=============================================================================
    -
    -CORBA::Long SMESH_Mesh_i::GetStudyId()throw(SALOME::SALOME_Exception)
    -{
    -  return _studyId;
    -}
    -
     //=============================================================================
     namespace
     {
    @@ -2976,9 +2938,9 @@ string SMESH_Mesh_i::prepareMeshNameAndGroups(const char*    file,
       // Perform Export
       PrepareForWriting(file, overwrite);
       string aMeshName = "Mesh";
    -  SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
    +  SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
       if ( !aStudy->_is_nil() ) {
    -    SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject( aStudy, _this() );
    +    SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject(  _this() );
         if ( !aMeshSO->_is_nil() ) {
           CORBA::String_var name = aMeshSO->GetName();
           aMeshName = name;
    @@ -3151,8 +3113,7 @@ void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii)
                     << ".ExportSTL( r'" << file << "', " << isascii << " )";
     
       CORBA::String_var name;
    -  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, _this() );
    +  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( _this() );
       if ( !so->_is_nil() )
         name = so->GetName();
     
    @@ -3234,14 +3195,12 @@ void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
     
         PrepareForWriting(file, overwrite);
     
    -    SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
    -    if ( !aStudy->_is_nil() ) {
    -      SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( aStudy, meshPart );
    -      if ( !SO->_is_nil() ) {
    -        CORBA::String_var name = SO->GetName();
    -        aMeshName = name;
    -      }
    +    SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( meshPart );
    +    if ( !SO->_is_nil() ) {
    +      CORBA::String_var name = SO->GetName();
    +      aMeshName = name;
         }
    +
         SMESH_MeshPartDS* partDS = new SMESH_MeshPartDS( meshPart );
         _impl->ExportMED( file, aMeshName.c_str(), auto_groups,
                           version, partDS, autoDimension, /*addODOnVertices=*/have0dField);
    @@ -3608,8 +3567,7 @@ void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart,
       PrepareForWriting(file);
     
       CORBA::String_var name;
    -  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, meshPart );
    +  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( meshPart );
       if ( !so->_is_nil() )
         name = so->GetName();
     
    @@ -3639,8 +3597,7 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart,
       PrepareForWriting(file,overwrite);
     
       std::string meshName("");
    -  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
    -  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, meshPart );
    +  SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( meshPart );
       if ( !so->_is_nil() )
       {
         CORBA::String_var name = so->GetName();
    @@ -4978,10 +4935,9 @@ SMESH_Mesh_i::MakeGroupsOfBadInputElements( int         theSubShapeID,
             groups[ ++iG ] = createGroup( SMESH::ElementType(i), theGroupName );
             if ( _gen_i->CanPublishInStudy( groups[ iG ] ))
             {
    -          SALOMEDS::Study_var  study = _gen_i->GetCurrentStudy();
               SMESH::SMESH_Mesh_var mesh = _this();
               SALOMEDS::SObject_wrap aSO =
    -            _gen_i->PublishGroup( study, mesh, groups[ iG ],
    +            _gen_i->PublishGroup( mesh, groups[ iG ],
                                      GEOM::GEOM_Object::_nil(), theGroupName);
             }
             SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( groups[ iG ]);
    @@ -5005,7 +4961,6 @@ SMESH_Mesh_i::MakeGroupsOfBadInputElements( int         theSubShapeID,
     
     void SMESH_Mesh_i::CreateGroupServants()
     {
    -  SALOMEDS::Study_var  aStudy = _gen_i->GetCurrentStudy();
       SMESH::SMESH_Mesh_var aMesh = _this();
     
       set addedIDs;
    @@ -5042,10 +4997,8 @@ void SMESH_Mesh_i::CreateGroupServants()
         else        { nextId = 0; } // avoid "unused variable" warning in release mode
     
         // publishing the groups in the study
    -    if ( !aStudy->_is_nil() ) {
    -      GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape );
    -      _gen_i->PublishGroup( aStudy, aMesh, groupVar, shapeVar, group->GetName());
    -    }
    +    GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape );
    +    _gen_i->PublishGroup( aMesh, groupVar, shapeVar, group->GetName());
       }
       if ( !addedIDs.empty() )
       {
    @@ -5111,10 +5064,6 @@ void SMESH_Mesh_i::checkGroupNames()
       int nbGrp = NbGroups();
       if ( !nbGrp )
         return;
    -
    -  SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
    -  if ( aStudy->_is_nil() )
    -    return; // nothing to do
       
       SMESH::ListOfGroups* grpList = 0;
       // avoid dump of "GetGroups"
    @@ -5128,7 +5077,7 @@ void SMESH_Mesh_i::checkGroupNames()
         SMESH::SMESH_GroupBase_ptr aGrp = (*grpList)[ gIndx ];
         if ( !aGrp )
           continue;
    -    SALOMEDS::SObject_wrap aGrpSO = _gen_i->ObjectToSObject( aStudy, aGrp );
    +    SALOMEDS::SObject_wrap aGrpSO = _gen_i->ObjectToSObject( aGrp );
         if ( aGrpSO->_is_nil() )
           continue;
         // correct name of the mesh group if necessary
    @@ -5171,15 +5120,12 @@ SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
       SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
       if(gen) {
         CORBA::String_var aParameters = GetParameters();
    -    SALOMEDS::Study_var    aStudy = gen->GetCurrentStudy();
    -    if ( !aStudy->_is_nil()) {
    -      SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters); 
    -      if ( aSections->length() > 0 ) {
    -        SALOMEDS::ListOfStrings aVars = aSections[ aSections->length() - 1 ];
    -        aResult->length( aVars.length() );
    -        for ( CORBA::ULong i = 0;i < aVars.length(); i++ )
    -          aResult[i] = CORBA::string_dup( aVars[i] );
    -      }
    +    SALOMEDS::ListOfListOfStrings_var aSections = SMESH_Gen_i::getStudyServant()->ParseVariables(aParameters);
    +    if ( aSections->length() > 0 ) {
    +      SALOMEDS::ListOfStrings aVars = aSections[ aSections->length() - 1 ];
    +      aResult->length( aVars.length() );
    +      for ( CORBA::ULong i = 0;i < aVars.length(); i++ )
    +        aResult[i] = CORBA::string_dup( aVars[i] );
         }
       }
       return aResult._retn();
    diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx
    index 62d08763d..f4c2cf71b 100644
    --- a/src/SMESH_I/SMESH_Mesh_i.hxx
    +++ b/src/SMESH_I/SMESH_Mesh_i.hxx
    @@ -59,8 +59,7 @@ class SMESH_I_EXPORT SMESH_Mesh_i:
       SMESH_Mesh_i(const SMESH_Mesh_i&);
     public:
       SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
    -                SMESH_Gen_i*            myGen_i,
    -                CORBA::Long             studyId );
    +                SMESH_Gen_i*            myGen_i );
     
       virtual ~SMESH_Mesh_i();
     
    @@ -185,8 +184,6 @@ public:
     
       CORBA::Long GetId() throw (SALOME::SALOME_Exception);
     
    -  CORBA::Long GetStudyId() throw (SALOME::SALOME_Exception);
    -
       // --- C++ interface
     
       void SetImpl(::SMESH_Mesh* impl);
    @@ -703,7 +700,6 @@ private:
       ::SMESH_Mesh* _impl;        // :: force no namespace here
       SMESH_Gen_i*  _gen_i;
       int           _id;          // id given by creator (unique within the creator instance)
    -  int           _studyId;
       std::map    _mapSubMeshIor;
       std::map  _mapGroups;
       std::map _mapHypo;
    diff --git a/src/SMESH_I/SMESH_NoteBook.cxx b/src/SMESH_I/SMESH_NoteBook.cxx
    index e4deee310..2b282b8d4 100644
    --- a/src/SMESH_I/SMESH_NoteBook.cxx
    +++ b/src/SMESH_I/SMESH_NoteBook.cxx
    @@ -707,8 +707,7 @@ void SMESH_NoteBook::ReplaceVariables()
             // dumped calls due to the fix of
             // issue 0021364:: Dump of netgen parameters has duplicate lines
             SMESH_Gen_i *          aGen = SMESH_Gen_i::GetSMESHGen();
    -        SALOMEDS::Study_var  aStudy = aGen->GetCurrentStudy();
    -        SALOMEDS::SObject_wrap sobj = aStudy->FindObjectID( (*it).first.ToCString() );
    +        SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( (*it).first.ToCString() );
             CORBA::Object_var       obj = aGen->SObjectToObject( sobj );
             if ( SMESH_Hypothesis_i* h = SMESH::DownCast< SMESH_Hypothesis_i*>( obj ))
             {
    @@ -745,7 +744,7 @@ void SMESH_NoteBook::InitObjectMap()
       if(!aGen)
         return;
       
    -  SALOMEDS::Study_var aStudy = aGen->GetCurrentStudy();
    +  SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
       if(aStudy->_is_nil())
         return;
       
    @@ -954,11 +953,7 @@ bool SMESH_NoteBook::GetReal(const TCollection_AsciiString& theVarName, double&
     {
       bool ok = false;
     
    -  SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
    -  if(!aGen)
    -    return ok;
    -
    -  SALOMEDS::Study_ptr aStudy = aGen->GetCurrentStudy();
    +  SALOMEDS::Study_ptr aStudy = SMESH_Gen_i::getStudyServant();
       if(aStudy->_is_nil())
         return ok;
     
    diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx
    index 3d8980ff9..e11046e1b 100644
    --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx
    +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx
    @@ -63,8 +63,8 @@ namespace
     {
       enum {  GroupOnFilter_OutOfDate = -1 };
     
    -  // a map to count not yet loaded meshes 
    -  static std::map< int, int > theStudyIDToMeshCounter;
    +  // count not yet loaded meshes
    +  static int theMeshCounter = 0;
     
       //================================================================================
       /*!
    @@ -74,9 +74,7 @@ namespace
     
       void meshInfoLoaded( SMESH_Mesh_i* mesh )
       {
    -    std::map< int, int >::iterator id2counter =
    -      theStudyIDToMeshCounter.insert( std::make_pair( (int) mesh->GetStudyId(), 0 )).first;
    -    id2counter->second++;
    +    theMeshCounter++;
       }
       //================================================================================
       /*!
    @@ -88,18 +86,18 @@ namespace
                              std::string   medFile,
                              std::string   hdfFile)
       {
    -    if ( --theStudyIDToMeshCounter[ (int) mesh->GetStudyId() ] == 0 )
    +    if ( --theMeshCounter == 0 )
         {
           std::string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile );
     
    -      SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
    -      aFiles->length(2);
    +      SALOMEDS_Tool::ListOfFiles aFiles;
    +      aFiles.reserve(2);
           medFile = SALOMEDS_Tool::GetNameFromPath( medFile ) + ".med";
           hdfFile = SALOMEDS_Tool::GetNameFromPath( hdfFile ) + ".hdf";
    -      aFiles[0] = medFile.c_str();
    -      aFiles[1] = hdfFile.c_str();
    +      aFiles.push_back(medFile.c_str());
    +      aFiles.push_back(hdfFile.c_str());
     
    -      SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles.in(), true );
    +      SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles, true );
         }
       }
     
    @@ -117,25 +115,22 @@ namespace
         SignalToGUI( SMESH_Mesh_i* mesh )
         {
           SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
    -      SALOMEDS::Study_var study = gen->GetCurrentStudy();
    -      if ( !study->_is_nil() && study->StudyId() == mesh->GetStudyId() )
    +
    +      SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( mesh->_this() );
    +      CORBA::Object_var        obj = gen->GetNS()->Resolve( "/Kernel/Session" );
    +      _session = SALOME::Session::_narrow( obj );
    +      if ( !meshSO->_is_nil() && !_session->_is_nil() )
           {
    -        SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject(study, mesh->_this() );
    -        CORBA::Object_var        obj = gen->GetNS()->Resolve( "/Kernel/Session" );
    -        _session = SALOME::Session::_narrow( obj );
    -        if ( !meshSO->_is_nil() && !_session->_is_nil() )
    -        {
    -          CORBA::String_var meshEntry = meshSO->GetID();
    -          _messagePrefix = "SMESH/mesh_loading/";
    -          _messagePrefix += meshEntry.in();
    +        CORBA::String_var meshEntry = meshSO->GetID();
    +        _messagePrefix = "SMESH/mesh_loading/";
    +        _messagePrefix += meshEntry.in();
     
    -          std::string msgToGUI = _messagePrefix + "/";
    -          msgToGUI += SMESH_Comment( mesh->NbNodes() );
    -          msgToGUI += "/";
    -          msgToGUI += SMESH_Comment( mesh->NbElements() );
    +        std::string msgToGUI = _messagePrefix + "/";
    +        msgToGUI += SMESH_Comment( mesh->NbNodes() );
    +        msgToGUI += "/";
    +        msgToGUI += SMESH_Comment( mesh->NbElements() );
     
    -          _session->emitMessageOneWay( msgToGUI.c_str());
    -        }
    +        _session->emitMessageOneWay( msgToGUI.c_str());
           }
         }
         void sendStop()
    @@ -1225,10 +1220,9 @@ bool SMESH_PreMeshInfo::IsMeshInfoCorrect() const
     
     void SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD(SALOMEDS::SComponent_ptr smeshComp)
     {
    -  SALOMEDS::Study_var study = smeshComp->GetStudy();
    -  if ( theStudyIDToMeshCounter[ (int) study->StudyId() ] > 0 )
    +  if ( theMeshCounter > 0 )
       {
    -    SALOMEDS::ChildIterator_wrap itBig = study->NewChildIterator( smeshComp );
    +    SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::getStudyServant()->NewChildIterator( smeshComp );
         for ( ; itBig->More(); itBig->Next() ) {
           SALOMEDS::SObject_wrap gotBranch = itBig->Value();
           CORBA::Object_var       anObject = SMESH_Gen_i::SObjectToObject( gotBranch );
    diff --git a/src/SMESH_I/SMESH_PythonDump.hxx b/src/SMESH_I/SMESH_PythonDump.hxx
    index 52baab303..f4ea88344 100644
    --- a/src/SMESH_I/SMESH_PythonDump.hxx
    +++ b/src/SMESH_I/SMESH_PythonDump.hxx
    @@ -69,7 +69,6 @@ public:
                     Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
                     Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                     std::set< TCollection_AsciiString >&      theRemovedObjIDs,
    -                SALOMEDS::Study_ptr&                      theStudy,
                     const bool                                theHistoricalDump);
     
       /*!
    diff --git a/src/SMESH_PY/smeshstudytools.py b/src/SMESH_PY/smeshstudytools.py
    index 3d407f85b..33f0d7b1a 100644
    --- a/src/SMESH_PY/smeshstudytools.py
    +++ b/src/SMESH_PY/smeshstudytools.py
    @@ -77,12 +77,12 @@ class SMeshStudyTools:
     
         ## This function updates the tools so that it works on the
         #  specified study.
    -    def updateStudy(self, studyId=None):
    +    def updateStudy(self):
             """
             This function updates the tools so that it works on the
             specified study.
             """
    -        self.editor = getStudyEditor(studyId)
    +        self.editor = getStudyEditor()
     
         ## Get the mesh item owning the mesh group \em meshGroupItem.
         #  \param  meshGroupItem (SObject) mesh group belonging to the searched mesh.
    @@ -125,7 +125,7 @@ class SMeshStudyTools:
                 return None
             import SMESH
             from salome.smesh import smeshBuilder
    -        smesh = smeshBuilder.New(self.editor.study)
    +        smesh = smeshBuilder.New()
     
             meshObject=salome.IDToObject(entry)
             return smesh.Mesh( meshObject )
    @@ -183,17 +183,16 @@ class SMeshStudyTools:
     
     
     def TEST_createBoxMesh():
    -    theStudy = helper.getActiveStudy()
         
         import GEOM
         from salome.geom import geomBuilder
    -    geompy = geomBuilder.New(theStudy)
    +    geompy = geomBuilder.New()
         
         box = geompy.MakeBoxDXDYDZ(200, 200, 200)
     
         import SMESH, SALOMEDS
         from salome.smesh import smeshBuilder
    -    smesh = smeshBuilder.New(theStudy) 
    +    smesh = smeshBuilder.New() 
     
         from salome.StdMeshers import StdMeshersBuilder
         boxmesh = smesh.Mesh(box)
    @@ -207,7 +206,7 @@ def TEST_createBoxMesh():
     
         smesh.SetName(boxmesh.GetMesh(), 'boxmesh')
         if salome.sg.hasDesktop():
    -        salome.sg.updateObjBrowser(True)
    +        salome.sg.updateObjBrowser()
     
     #
     # Definitions:
    diff --git a/src/SMESH_SWIG/PAL_MESH_041_mesh.py b/src/SMESH_SWIG/PAL_MESH_041_mesh.py
    index 67f0ba76d..86dc13003 100755
    --- a/src/SMESH_SWIG/PAL_MESH_041_mesh.py
    +++ b/src/SMESH_SWIG/PAL_MESH_041_mesh.py
    @@ -25,11 +25,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     
     #-----------------------------GEOM----------------------------------------
    @@ -103,5 +103,5 @@ print "---------------------Compute the mesh"
     ret = mesh.Compute()
     print ret
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
     
    diff --git a/src/SMESH_SWIG/PAL_MESH_043_2D.py b/src/SMESH_SWIG/PAL_MESH_043_2D.py
    index a627b543c..4f7866cb6 100755
    --- a/src/SMESH_SWIG/PAL_MESH_043_2D.py
    +++ b/src/SMESH_SWIG/PAL_MESH_043_2D.py
    @@ -29,11 +29,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     
     #----------------------------------GEOM
    @@ -81,4 +81,4 @@ mesh2.Compute()
     
     
     # ---- udate object browser
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/PAL_MESH_043_3D.py b/src/SMESH_SWIG/PAL_MESH_043_3D.py
    index 5611f172e..248554646 100755
    --- a/src/SMESH_SWIG/PAL_MESH_043_3D.py
    +++ b/src/SMESH_SWIG/PAL_MESH_043_3D.py
    @@ -29,11 +29,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     
     # create points to build two circles
    @@ -90,4 +90,4 @@ mesh1.Compute()
     mesh2.Compute()
     
     # ---- update object browser
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_AdvancedEditor.py b/src/SMESH_SWIG/SMESH_AdvancedEditor.py
    index 7d2ee5a09..5112ec70a 100644
    --- a/src/SMESH_SWIG/SMESH_AdvancedEditor.py
    +++ b/src/SMESH_SWIG/SMESH_AdvancedEditor.py
    @@ -25,11 +25,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import math
     
    @@ -217,4 +217,4 @@ for i in range(0,nbrs):
         oldnodes = newnodes
         pass
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_BelongToGeom.py b/src/SMESH_SWIG/SMESH_BelongToGeom.py
    index cc25ccda9..953ac62f4 100644
    --- a/src/SMESH_SWIG/SMESH_BelongToGeom.py
    +++ b/src/SMESH_SWIG/SMESH_BelongToGeom.py
    @@ -63,4 +63,4 @@ print "anIds = ", anIds
     #anIds = CheckBelongToGeomFilterOld(smesh,mesh.GetMesh(),box,box,anElemType)
     #print "anIds = ", anIds
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_BuildCompound.py b/src/SMESH_SWIG/SMESH_BuildCompound.py
    index 4a197353f..d6b8ec64b 100644
    --- a/src/SMESH_SWIG/SMESH_BuildCompound.py
    +++ b/src/SMESH_SWIG/SMESH_BuildCompound.py
    @@ -31,11 +31,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     ## create a bottom box
     Box_inf = geompy.MakeBox(0., 0., 0., 200., 200., 50.)
    @@ -104,4 +104,4 @@ Compound2 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e
     smesh.SetName(Compound2, 'Compound_with_UniteGrps_and_GrpsOfAllElems')
     #end
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_GroupFromGeom.py b/src/SMESH_SWIG/SMESH_GroupFromGeom.py
    index b0e936b19..4383ab447 100644
    --- a/src/SMESH_SWIG/SMESH_GroupFromGeom.py
    +++ b/src/SMESH_SWIG/SMESH_GroupFromGeom.py
    @@ -47,4 +47,4 @@ geompy.addToStudy(aGeomGroup2, "Group on Edges")
     aSmeshGroup1 = mesh.GroupOnGeom(aGeomGroup1, "SMESHGroup1", SMESH.FACE)
     aSmeshGroup2 = mesh.GroupOnGeom(aGeomGroup2, "SMESHGroup2", SMESH.EDGE)
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_GroupFromGeom2.py b/src/SMESH_SWIG/SMESH_GroupFromGeom2.py
    index 498235198..324ca1d10 100755
    --- a/src/SMESH_SWIG/SMESH_GroupFromGeom2.py
    +++ b/src/SMESH_SWIG/SMESH_GroupFromGeom2.py
    @@ -74,4 +74,4 @@ mesh.Compute()
     print "aGroupOnShell size =", aGroupOnShell.Size()
     print "aGroupOnShell ids :", aGroupOnShell.GetListOfID()
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py
    index 4d7f05901..f0e56293d 100644
    --- a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py
    +++ b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py
    @@ -47,4 +47,4 @@ BuildGroupLyingOn(mesh.GetMesh(), SMESH.FACE, "Group of faces lying on edge #1",
     # Second way
     mesh.MakeGroup("Group of faces lying on edge #2", SMESH.FACE, SMESH.FT_LyingOnGeom, edge)
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_Nut.py b/src/SMESH_SWIG/SMESH_Nut.py
    index 3e27b57ce..293a62390 100755
    --- a/src/SMESH_SWIG/SMESH_Nut.py
    +++ b/src/SMESH_SWIG/SMESH_Nut.py
    @@ -30,11 +30,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import os
     import math
    @@ -158,4 +158,4 @@ print "Number of quadrangles : ", mesh.NbQuadrangles()
     print "Number of volumes     : ", mesh.NbVolumes()
     print "Number of tetrahedrons: ", mesh.NbTetras()
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_Partition1_tetra.py b/src/SMESH_SWIG/SMESH_Partition1_tetra.py
    index aee34bb7e..0b6667fe4 100644
    --- a/src/SMESH_SWIG/SMESH_Partition1_tetra.py
    +++ b/src/SMESH_SWIG/SMESH_Partition1_tetra.py
    @@ -29,11 +29,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     from math import sqrt
     
    @@ -43,7 +43,7 @@ from math import sqrt
     barier_height = 7.0
     barier_radius = 5.6 / 2 # Rayon de la bariere
     colis_radius = 1.0 / 2  # Rayon du colis
    -colis_step = 2.0        # Distance s‰parant deux colis
    +colis_step = 2.0        # Distance s�parant deux colis
     cc_width = 0.11         # Epaisseur du complement de colisage
     
     # --
    @@ -184,4 +184,4 @@ if ret != 0:
     else:
         print "problem when computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_Sphere.py b/src/SMESH_SWIG/SMESH_Sphere.py
    index faadf285e..be5e1e24e 100644
    --- a/src/SMESH_SWIG/SMESH_Sphere.py
    +++ b/src/SMESH_SWIG/SMESH_Sphere.py
    @@ -31,11 +31,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import math
     
    @@ -118,4 +118,4 @@ my_hexa.Quadrangle()
     my_hexa.Hexahedron()
     my_hexa.Compute()
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_blocks.py b/src/SMESH_SWIG/SMESH_blocks.py
    index b8a4707e3..4d25b4a96 100644
    --- a/src/SMESH_SWIG/SMESH_blocks.py
    +++ b/src/SMESH_SWIG/SMESH_blocks.py
    @@ -31,11 +31,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import math
     
    @@ -46,4 +46,4 @@ isMeshTest   = 1 # True
     
     GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh)
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_box.py b/src/SMESH_SWIG/SMESH_box.py
    index 1d486f24a..e7a894726 100755
    --- a/src/SMESH_SWIG/SMESH_box.py
    +++ b/src/SMESH_SWIG/SMESH_box.py
    @@ -34,11 +34,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     from salome import sg
     
    @@ -70,4 +70,4 @@ alg3D.SetName("algo3D")
     
     box_mesh.Compute()
     
    -sg.updateObjBrowser(True)
    +sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_box2_tetra.py b/src/SMESH_SWIG/SMESH_box2_tetra.py
    index 6bba8e165..6d137e9d8 100644
    --- a/src/SMESH_SWIG/SMESH_box2_tetra.py
    +++ b/src/SMESH_SWIG/SMESH_box2_tetra.py
    @@ -28,11 +28,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     
     # ---- define 2 boxes box1 and box2
    @@ -138,4 +138,4 @@ if ret != 0:
     else:
         print "probleme when computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_box3_tetra.py b/src/SMESH_SWIG/SMESH_box3_tetra.py
    index 6121df448..2fa39e644 100644
    --- a/src/SMESH_SWIG/SMESH_box3_tetra.py
    +++ b/src/SMESH_SWIG/SMESH_box3_tetra.py
    @@ -29,11 +29,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---- define 3 boxes box1, box2 and box3
     
    @@ -148,4 +148,4 @@ if ret != 0:
     else:
         print "probleme when computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_box_tetra.py b/src/SMESH_SWIG/SMESH_box_tetra.py
    index 4938de61e..61538ebf8 100644
    --- a/src/SMESH_SWIG/SMESH_box_tetra.py
    +++ b/src/SMESH_SWIG/SMESH_box_tetra.py
    @@ -28,11 +28,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---- define a boxe
     
    @@ -107,4 +107,4 @@ if ret != 0:
     else:
         print "probleme when computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_controls.py b/src/SMESH_SWIG/SMESH_controls.py
    index dfefee94c..a1d04d21d 100644
    --- a/src/SMESH_SWIG/SMESH_controls.py
    +++ b/src/SMESH_SWIG/SMESH_controls.py
    @@ -30,7 +30,7 @@ import SMESH_mechanic
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     mesh = SMESH_mechanic.mesh
     
     # ---- Criterion : AREA > 100
    @@ -141,4 +141,4 @@ print "Criterion: Element Diameter 2D > 10 Nb = ", len( anIds )
       #print anIds[ i ]
     
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py b/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py
    index ef6ea57c1..9629def07 100755
    --- a/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py
    +++ b/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py
    @@ -36,11 +36,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import math
     
    @@ -131,7 +131,7 @@ for i in range(8):
         idEdgeZ.append(geompy.addToStudyInFather(vol,edgeZ[i],"EdgeZ"+str(i+1)))
     
     ### ---------------------------- SMESH --------------------------------------
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     # ---- init a Mesh with the volume
     
    @@ -176,7 +176,7 @@ for i in range(8):
         smesh.SetName(algo.GetSubMesh(), "SubMeshEdgeZ_"+str(i+1))
       
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
     
     print "-------------------------- compute the mesh of the volume"
     
    @@ -197,4 +197,4 @@ if ret != 0:
     else:
         print "problem when Computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_fixation.py b/src/SMESH_SWIG/SMESH_fixation.py
    index 6462381c2..b4a4f7224 100644
    --- a/src/SMESH_SWIG/SMESH_fixation.py
    +++ b/src/SMESH_SWIG/SMESH_fixation.py
    @@ -30,7 +30,7 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import math
     
    diff --git a/src/SMESH_SWIG/SMESH_fixation_hexa.py b/src/SMESH_SWIG/SMESH_fixation_hexa.py
    index 7d9245c3b..0f464cf42 100644
    --- a/src/SMESH_SWIG/SMESH_fixation_hexa.py
    +++ b/src/SMESH_SWIG/SMESH_fixation_hexa.py
    @@ -30,7 +30,7 @@ import SMESH_fixation
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     compshell = SMESH_fixation.compshell
     idcomp = SMESH_fixation.idcomp
    @@ -50,7 +50,7 @@ status = geompy.CheckShape(compshell)
     print " check status ", status
     
     ### ---------------------------- SMESH --------------------------------------
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     # ---- init a Mesh with the compshell
     shape_mesh = salome.IDToObject( idcomp  )
    @@ -99,4 +99,4 @@ if ret != 0:
     else:
         print "problem when Computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_fixation_netgen.py b/src/SMESH_SWIG/SMESH_fixation_netgen.py
    index ed2c999f4..fbcbc1a18 100644
    --- a/src/SMESH_SWIG/SMESH_fixation_netgen.py
    +++ b/src/SMESH_SWIG/SMESH_fixation_netgen.py
    @@ -30,7 +30,7 @@ import SMESH_fixation
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     compshell = SMESH_fixation.compshell
     idcomp = SMESH_fixation.idcomp
    @@ -50,7 +50,7 @@ status = geompy.CheckShape(compshell)
     print " check status ", status
     
     ### ---------------------------- SMESH --------------------------------------
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     print "-------------------------- create Mesh, algorithm, hypothesis"
     
    @@ -76,4 +76,4 @@ if ret != 0:
     else:
         print "problem when computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_fixation_tetra.py b/src/SMESH_SWIG/SMESH_fixation_tetra.py
    index 4f578dd01..dd661d969 100644
    --- a/src/SMESH_SWIG/SMESH_fixation_tetra.py
    +++ b/src/SMESH_SWIG/SMESH_fixation_tetra.py
    @@ -30,7 +30,7 @@ import SMESH_fixation
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     compshell = SMESH_fixation.compshell
     idcomp = SMESH_fixation.idcomp
    @@ -50,7 +50,7 @@ status = geompy.CheckShape(compshell)
     print " check status ", status
     
     ### ---------------------------- SMESH --------------------------------------
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     # ---- init a Mesh with the compshell
     
    @@ -123,4 +123,4 @@ if ret != 0:
     else:
         print "problem when computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_flight_skin.py b/src/SMESH_SWIG/SMESH_flight_skin.py
    index 44ca46630..122ebabfd 100644
    --- a/src/SMESH_SWIG/SMESH_flight_skin.py
    +++ b/src/SMESH_SWIG/SMESH_flight_skin.py
    @@ -29,11 +29,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     
     # ---------------------------- GEOM --------------------------------------
    @@ -62,7 +62,7 @@ print "number of Edges  in flight : ", len(subEdgeList)
     
     
     ### ---------------------------- SMESH --------------------------------------
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     # ---- init a Mesh with the shell
     shape_mesh = salome.IDToObject( idShape )
    @@ -107,4 +107,4 @@ if ret != 0:
     else:
         print "probleme when computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_freebord.py b/src/SMESH_SWIG/SMESH_freebord.py
    index 7bd4f3a83..a45499144 100644
    --- a/src/SMESH_SWIG/SMESH_freebord.py
    +++ b/src/SMESH_SWIG/SMESH_freebord.py
    @@ -25,11 +25,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     
     # Create box without one plane
    @@ -48,7 +48,7 @@ idbox = geompy.addToStudy( aBox, "box" )
     aBox  = salome.IDToObject( idbox )
     
     # Create mesh
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     mesh = smesh.Mesh(aBox, "Mesh_freebord")
     
    @@ -75,4 +75,4 @@ print "Criterion: Free edges Nb = ", len( anIds )
     for i in range( len( anIds ) ):
       print anIds[ i ]
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_hexaedre.py b/src/SMESH_SWIG/SMESH_hexaedre.py
    index a2dd15b93..6a215780a 100755
    --- a/src/SMESH_SWIG/SMESH_hexaedre.py
    +++ b/src/SMESH_SWIG/SMESH_hexaedre.py
    @@ -24,11 +24,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # -----------------------------------------------------------------------------
     
    @@ -58,12 +58,12 @@ idblob = geompy.addToStudy(blob,"blob")
     edgeGroups = geompy.Propagate( blob )
     assert len( edgeGroups ) == 3
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
     
     # -----------------------------------------------------------------------------
     
     print "-------------------------- mesh"
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     # ---- define a mesh on the geom shape 'blob'
     mesh=smesh.Mesh(blob, "MeshBlob")
    @@ -98,4 +98,4 @@ if ok:
     else:
         print "problem when Computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_mechanic.py b/src/SMESH_SWIG/SMESH_mechanic.py
    index b04453581..e2ba044c4 100644
    --- a/src/SMESH_SWIG/SMESH_mechanic.py
    +++ b/src/SMESH_SWIG/SMESH_mechanic.py
    @@ -31,11 +31,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     from salome.StdMeshers import StdMeshersBuilder
     
    @@ -127,7 +127,7 @@ name      = geompy.SubShapeName( sub_face4, mechanic )
     Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
     
     # ---------------------------- SMESH --------------------------------------
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     # -- Init --
     shape_mesh = salome.IDToObject( Id_mechanic )
    @@ -188,4 +188,4 @@ print "Number of quadrangles : ", mesh.NbQuadrangles()
     print "Number of volumes     : ", mesh.NbVolumes()
     print "Number of tetrahedrons: ", mesh.NbTetras()
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_mechanic_editor.py b/src/SMESH_SWIG/SMESH_mechanic_editor.py
    index bb340bc95..741fc38ea 100644
    --- a/src/SMESH_SWIG/SMESH_mechanic_editor.py
    +++ b/src/SMESH_SWIG/SMESH_mechanic_editor.py
    @@ -31,11 +31,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---------------------------- GEOM --------------------------------------
     
    @@ -234,4 +234,4 @@ mesh.RotationSweepObject(GroupRotate, axisXYZ, angle45, 4, 1e-5)
     #9 reorientation of the submesh1
     mesh.ReorientObject(submesh1)
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_mechanic_netgen.py b/src/SMESH_SWIG/SMESH_mechanic_netgen.py
    index 326348b7c..e824149e8 100644
    --- a/src/SMESH_SWIG/SMESH_mechanic_netgen.py
    +++ b/src/SMESH_SWIG/SMESH_mechanic_netgen.py
    @@ -29,11 +29,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---------------------------- GEOM --------------------------------------
     
    @@ -135,4 +135,4 @@ if ret != 0:
     else:
         print "problem when computing the mesh"
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_mechanic_tetra.py b/src/SMESH_SWIG/SMESH_mechanic_tetra.py
    index 18925dac7..815ad0d90 100644
    --- a/src/SMESH_SWIG/SMESH_mechanic_tetra.py
    +++ b/src/SMESH_SWIG/SMESH_mechanic_tetra.py
    @@ -30,11 +30,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---------------------------- GEOM --------------------------------------
     
    @@ -158,4 +158,4 @@ print "Number of quadrangles: ", mesh.NbQuadrangles()
     print "Number of volumes     : ", mesh.NbVolumes()
     print "Number of tetrahedrons: ", mesh.NbTetras()
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_reg.py b/src/SMESH_SWIG/SMESH_reg.py
    index 1ce3e6cba..3b852193b 100644
    --- a/src/SMESH_SWIG/SMESH_reg.py
    +++ b/src/SMESH_SWIG/SMESH_reg.py
    @@ -28,11 +28,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     from salome.StdMeshers import StdMeshersBuilder
     
    @@ -60,12 +60,12 @@ for f in subShapeList:
       print name
       idedge.append( geompy.addToStudyInFather(box, f, name) )
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
     
     # ---- launch SMESH
     smeshgui = salome.ImportComponentGUI("SMESH")
    -smeshgui.Init(salome.myStudyId)
    -smesh.SetCurrentStudy(salome.myStudy)
    +smeshgui.Init()
    +smesh.UpdateStudy()
     
     # ---- Creating meshes
     
    @@ -115,5 +115,5 @@ algo = mesh.Triangle()
     algo.MaxElementArea(2500)
     
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
     
    diff --git a/src/SMESH_SWIG/SMESH_test.py b/src/SMESH_SWIG/SMESH_test.py
    index 9b40d7194..e8e6f4d1a 100644
    --- a/src/SMESH_SWIG/SMESH_test.py
    +++ b/src/SMESH_SWIG/SMESH_test.py
    @@ -29,11 +29,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---- define a box
     
    @@ -63,7 +63,7 @@ ide = geompy.addToStudyInFather(face, edge, name)
     
     # ---- SMESH
     
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     box = salome.IDToObject(idb)
     mesh = smesh.Mesh(box, "Meshbox")
     
    @@ -147,4 +147,4 @@ for a in log:
                 ii = ii+1
                 print "AddTriangle %i - %i %i %i" % (ind, i1, i2, i3)
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_test0.py b/src/SMESH_SWIG/SMESH_test0.py
    index 23339f35f..625eaafb5 100644
    --- a/src/SMESH_SWIG/SMESH_test0.py
    +++ b/src/SMESH_SWIG/SMESH_test0.py
    @@ -28,11 +28,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---- define a box
     
    @@ -63,4 +63,4 @@ name = geompy.SubShapeName(edge, face)
     print name
     idedge = geompy.addToStudyInFather(face, edge, name)
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_test1.py b/src/SMESH_SWIG/SMESH_test1.py
    index ffc08c680..bbd3576db 100644
    --- a/src/SMESH_SWIG/SMESH_test1.py
    +++ b/src/SMESH_SWIG/SMESH_test1.py
    @@ -28,11 +28,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---- define a box
     
    @@ -110,4 +110,4 @@ print hypArea2.GetMaxElementArea()
     smesh.SetName(hypArea2, "MaxElementArea_500")
     
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_test1_AndDisplay.py b/src/SMESH_SWIG/SMESH_test1_AndDisplay.py
    index 0c510a129..97ac10826 100644
    --- a/src/SMESH_SWIG/SMESH_test1_AndDisplay.py
    +++ b/src/SMESH_SWIG/SMESH_test1_AndDisplay.py
    @@ -28,11 +28,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # ---- define a box
     
    @@ -111,7 +111,7 @@ smesh.SetName(hypArea2, "MaxElementArea_500")
     
     mesh.Compute()
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
     
     sg = salome.ImportComponentGUI('SMESH')
     if type(sg) != type(salome.salome_ComponentGUI):
    diff --git a/src/SMESH_SWIG/SMESH_test2.py b/src/SMESH_SWIG/SMESH_test2.py
    index c7dc5b14a..092cf447d 100644
    --- a/src/SMESH_SWIG/SMESH_test2.py
    +++ b/src/SMESH_SWIG/SMESH_test2.py
    @@ -35,4 +35,4 @@ log = mesh.GetLog(0); # no erase trace
     for linelog in log:
         print linelog
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_test3.py b/src/SMESH_SWIG/SMESH_test3.py
    index e52095547..5f9e9c615 100644
    --- a/src/SMESH_SWIG/SMESH_test3.py
    +++ b/src/SMESH_SWIG/SMESH_test3.py
    @@ -29,11 +29,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     import math
     
     pi = math.pi
    diff --git a/src/SMESH_SWIG/SMESH_test4.py b/src/SMESH_SWIG/SMESH_test4.py
    index 6467319a6..c0377cc97 100755
    --- a/src/SMESH_SWIG/SMESH_test4.py
    +++ b/src/SMESH_SWIG/SMESH_test4.py
    @@ -25,11 +25,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     
     # ---- GEOM
    @@ -47,7 +47,7 @@ face = salome.IDToObject(idface)
     
     # ---- SMESH
     
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     mesh = smesh.Mesh(box, "Meshbox")
     
     # Set 1D algorithm/hypotheses to mesh
    @@ -77,4 +77,4 @@ if len(faces) > 1:
         group1.Add(faces[:int(len(faces)/2)])
         group2.Add(faces[int(len(faces)/2):])
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/SMESH_test5.py b/src/SMESH_SWIG/SMESH_test5.py
    index 0464598cc..d42b73414 100644
    --- a/src/SMESH_SWIG/SMESH_test5.py
    +++ b/src/SMESH_SWIG/SMESH_test5.py
    @@ -28,11 +28,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import CORBA
     import os
    @@ -81,4 +81,4 @@ for iFile in range(len(aListDir)) :
             ConvertMED2UNV(aPath,aFileName)
             #break
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py
    index 4fef40fab..e04d431c2 100644
    --- a/src/SMESH_SWIG/StdMeshersBuilder.py
    +++ b/src/SMESH_SWIG/StdMeshersBuilder.py
    @@ -992,10 +992,9 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
             if not self.nbLayers is None:
                 self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
                 self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
    -        study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
    -        self.mesh.smeshpyD.SetCurrentStudy( None )
    +        self.mesh.smeshpyD.SetEnablePublish( False ) # prevents publishing own 1D hypothesis
             hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
    -        self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
    +        self.mesh.smeshpyD.SetEnablePublish( True ) # enables publishing
             if not self.distribHyp:
                 self.distribHyp = self.Hypothesis("LayerDistribution", UseExisting=0)
             self.distribHyp.SetLayerDistribution( hyp )
    @@ -1159,10 +1158,9 @@ class StdMeshersBuilder_RadialAlgorithm(Mesh_Algorithm):
                 self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
             else:
                 self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
    -        study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
    -        self.mesh.smeshpyD.SetCurrentStudy( None )
    +        self.mesh.smeshpyD.SetEnablePublish( False )
             hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
    -        self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
    +        self.mesh.smeshpyD.SetEnablePublish( True )
             self.distribHyp.SetLayerDistribution( hyp )
             return hyp
     
    diff --git a/src/SMESH_SWIG/ex01_cube2build.py b/src/SMESH_SWIG/ex01_cube2build.py
    index d29303898..17a4a01f1 100644
    --- a/src/SMESH_SWIG/ex01_cube2build.py
    +++ b/src/SMESH_SWIG/ex01_cube2build.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -323,4 +323,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex02_cube2primitive.py b/src/SMESH_SWIG/ex02_cube2primitive.py
    index eca7e708d..e47fde7e7 100644
    --- a/src/SMESH_SWIG/ex02_cube2primitive.py
    +++ b/src/SMESH_SWIG/ex02_cube2primitive.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -125,4 +125,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex03_cube2partition.py b/src/SMESH_SWIG/ex03_cube2partition.py
    index 4d4205988..302256fa1 100644
    --- a/src/SMESH_SWIG/ex03_cube2partition.py
    +++ b/src/SMESH_SWIG/ex03_cube2partition.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -112,4 +112,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex04_cube5tetraHexa.py b/src/SMESH_SWIG/ex04_cube5tetraHexa.py
    index 74709a288..96cb23479 100644
    --- a/src/SMESH_SWIG/ex04_cube5tetraHexa.py
    +++ b/src/SMESH_SWIG/ex04_cube5tetraHexa.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -117,4 +117,4 @@ mixed.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex05_hole1build.py b/src/SMESH_SWIG/ex05_hole1build.py
    index 63049972c..da8c97525 100644
    --- a/src/SMESH_SWIG/ex05_hole1build.py
    +++ b/src/SMESH_SWIG/ex05_hole1build.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import math
     
    @@ -152,4 +152,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex06_hole1boolean.py b/src/SMESH_SWIG/ex06_hole1boolean.py
    index 252b4e896..dc59840da 100644
    --- a/src/SMESH_SWIG/ex06_hole1boolean.py
    +++ b/src/SMESH_SWIG/ex06_hole1boolean.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -169,4 +169,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex07_hole1partition.py b/src/SMESH_SWIG/ex07_hole1partition.py
    index 099204117..20de60dec 100644
    --- a/src/SMESH_SWIG/ex07_hole1partition.py
    +++ b/src/SMESH_SWIG/ex07_hole1partition.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -109,4 +109,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex08_hole2build.py b/src/SMESH_SWIG/ex08_hole2build.py
    index a9d4579c8..d4577d2fa 100644
    --- a/src/SMESH_SWIG/ex08_hole2build.py
    +++ b/src/SMESH_SWIG/ex08_hole2build.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -142,4 +142,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex09_grid4build.py b/src/SMESH_SWIG/ex09_grid4build.py
    index 63222cb36..b610ac554 100644
    --- a/src/SMESH_SWIG/ex09_grid4build.py
    +++ b/src/SMESH_SWIG/ex09_grid4build.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import math
     
    @@ -145,4 +145,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex10_grid4geometry.py b/src/SMESH_SWIG/ex10_grid4geometry.py
    index 24cd31d44..6fb26f2d5 100644
    --- a/src/SMESH_SWIG/ex10_grid4geometry.py
    +++ b/src/SMESH_SWIG/ex10_grid4geometry.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -107,4 +107,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex11_grid3partition.py b/src/SMESH_SWIG/ex11_grid3partition.py
    index 91b6a3d26..ae75f84c1 100644
    --- a/src/SMESH_SWIG/ex11_grid3partition.py
    +++ b/src/SMESH_SWIG/ex11_grid3partition.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -128,4 +128,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex12_grid17partition.py b/src/SMESH_SWIG/ex12_grid17partition.py
    index 55164b777..02e468333 100644
    --- a/src/SMESH_SWIG/ex12_grid17partition.py
    +++ b/src/SMESH_SWIG/ex12_grid17partition.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -143,4 +143,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex13_hole1partial.py b/src/SMESH_SWIG/ex13_hole1partial.py
    index 6cb4b1c2d..6982aa606 100644
    --- a/src/SMESH_SWIG/ex13_hole1partial.py
    +++ b/src/SMESH_SWIG/ex13_hole1partial.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -261,4 +261,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex14_cyl1holed.py b/src/SMESH_SWIG/ex14_cyl1holed.py
    index f908a3d76..1167d6390 100644
    --- a/src/SMESH_SWIG/ex14_cyl1holed.py
    +++ b/src/SMESH_SWIG/ex14_cyl1holed.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometrie
     # =========
    @@ -146,4 +146,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex15_cyl2geometry.py b/src/SMESH_SWIG/ex15_cyl2geometry.py
    index 42cfbaad7..46be8da3b 100644
    --- a/src/SMESH_SWIG/ex15_cyl2geometry.py
    +++ b/src/SMESH_SWIG/ex15_cyl2geometry.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometrie
     # =========
    @@ -205,4 +205,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex16_cyl2complementary.py b/src/SMESH_SWIG/ex16_cyl2complementary.py
    index d7ec0ea1d..cb8ce46f0 100644
    --- a/src/SMESH_SWIG/ex16_cyl2complementary.py
    +++ b/src/SMESH_SWIG/ex16_cyl2complementary.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -149,4 +149,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex17_dome1.py b/src/SMESH_SWIG/ex17_dome1.py
    index 4d8b06aeb..22a9c1d1e 100644
    --- a/src/SMESH_SWIG/ex17_dome1.py
    +++ b/src/SMESH_SWIG/ex17_dome1.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometrie
     # =========
    @@ -107,4 +107,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex18_dome2.py b/src/SMESH_SWIG/ex18_dome2.py
    index 3721e9a6b..afd7dc26f 100644
    --- a/src/SMESH_SWIG/ex18_dome2.py
    +++ b/src/SMESH_SWIG/ex18_dome2.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import math
     
    @@ -145,4 +145,4 @@ hexa.Compute()
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex19_sphereINcube.py b/src/SMESH_SWIG/ex19_sphereINcube.py
    index 4528d5323..2bc7abf55 100644
    --- a/src/SMESH_SWIG/ex19_sphereINcube.py
    +++ b/src/SMESH_SWIG/ex19_sphereINcube.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometrie
     # =========
    @@ -190,4 +190,4 @@ hexa_groupe = hexa.Group(groupe)
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex21_lamp.py b/src/SMESH_SWIG/ex21_lamp.py
    index 034037120..04e7d4d2b 100644
    --- a/src/SMESH_SWIG/ex21_lamp.py
    +++ b/src/SMESH_SWIG/ex21_lamp.py
    @@ -27,11 +27,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Geometry
     # ========
    @@ -136,4 +136,4 @@ tetra.Group(group)
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    \ No newline at end of file
    +salome.sg.updateObjBrowser()
    \ No newline at end of file
    diff --git a/src/SMESH_SWIG/ex24_cylinder.py b/src/SMESH_SWIG/ex24_cylinder.py
    index 87b4cfbe0..57b7c1ff1 100644
    --- a/src/SMESH_SWIG/ex24_cylinder.py
    +++ b/src/SMESH_SWIG/ex24_cylinder.py
    @@ -26,11 +26,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     geo = geompy
     
    @@ -103,7 +103,7 @@ geompy.DifferenceList(group_1, [group_1_box])
     # Mesh the blocks with hexahedral
     # -------------------------------
     
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     def discretize(x, y, z,  n, s=blocks):
         p = geompy.MakeVertex(x, y, z)
    @@ -134,4 +134,4 @@ hexa.Group(group_1)
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex29_refine.py b/src/SMESH_SWIG/ex29_refine.py
    index 72e0f631a..69754d2b7 100644
    --- a/src/SMESH_SWIG/ex29_refine.py
    +++ b/src/SMESH_SWIG/ex29_refine.py
    @@ -25,11 +25,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import os
     
    @@ -232,4 +232,4 @@ MyMesh.ExportMED(path+str(NbCells4)+"_triangles.med", 0)
     # Update the object browser
     # -------------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex30_groupsOp.py b/src/SMESH_SWIG/ex30_groupsOp.py
    index 7b9f96c33..76a0593fd 100755
    --- a/src/SMESH_SWIG/ex30_groupsOp.py
    +++ b/src/SMESH_SWIG/ex30_groupsOp.py
    @@ -22,18 +22,18 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     import math
     
     global Face_1
     Face_1 = geompy.MakeFaceHW(100, 100, 1)
     geompy.addToStudy( Face_1, "Face_1" )
     
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     from salome.StdMeshers import StdMeshersBuilder
     pattern = smesh.GetPattern()
     Mesh_1 = smesh.Mesh(Face_1)
    @@ -87,5 +87,5 @@ aIntGrp=Mesh_1.IntersectListOfGroups([aRedGroup, aGreenGroup, aBlueGroup], "IntG
     # CutListOfGroups()
     aCutGrp=Mesh_1.CutListOfGroups([aRedGroup],[aGreenGroup,aBlueGroup],"CutGrp")
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
     
    diff --git a/src/SMESH_SWIG/ex30_tepal.py b/src/SMESH_SWIG/ex30_tepal.py
    index cd8e7bdc1..501b2f5b5 100644
    --- a/src/SMESH_SWIG/ex30_tepal.py
    +++ b/src/SMESH_SWIG/ex30_tepal.py
    @@ -26,11 +26,11 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     # Parameters
     # ----------
    @@ -53,7 +53,7 @@ geompy.addToStudy(cylinder, "Cylinder")
     # Define a mesh on a geometry
     # ---------------------------
     
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     
     m = smesh.Mesh(cylinder)
     
    @@ -94,4 +94,4 @@ else:
     # Update object browser
     # ---------------------
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
    diff --git a/src/SMESH_SWIG/ex31_dimGroup.py b/src/SMESH_SWIG/ex31_dimGroup.py
    index 1643ae99a..7be95f2ac 100755
    --- a/src/SMESH_SWIG/ex31_dimGroup.py
    +++ b/src/SMESH_SWIG/ex31_dimGroup.py
    @@ -22,18 +22,18 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     import math
     
     global Box_1
     Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
     geompy.addToStudy( Box_1, "Box_1" )
     
    -smesh.SetCurrentStudy(salome.myStudy)
    +smesh.UpdateStudy()
     from salome.StdMeshers import StdMeshersBuilder
     Mesh_1 = smesh.Mesh(Box_1)
     Regular_1D = Mesh_1.Segment()
    @@ -60,5 +60,5 @@ aGrp1D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], SMESH.EDGE, "Edges" )
     
     aGrp0D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], SMESH.NODE, "Nodes" )
     
    -salome.sg.updateObjBrowser(True)
    +salome.sg.updateObjBrowser()
     
    diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py
    index 7538d91a3..0fdd1aeb3 100644
    --- a/src/SMESH_SWIG/smesh.py
    +++ b/src/SMESH_SWIG/smesh.py
    @@ -42,7 +42,7 @@ from salome.smesh import smeshBuilder
     try:
         # get instance of class smeshBuilder
         engineSmesh = salome.lcc.FindOrLoadComponent( "FactoryServer", "SMESH" )
    -    smesh = smeshBuilder.New(salome.myStudy, engineSmesh)
    +    smesh = smeshBuilder.New(True,engineSmesh)
     except:
         print "exception in smesh.py: instance creation failed"
         smesh = None
    @@ -99,14 +99,13 @@ replace
     -------
     
     import smesh, SMESH
    -smesh.SetCurrentStudy(theStudy)
     
     with
     ----
     
     import SMESH
     from salome.smesh import smeshBuilder
    -smesh = smeshBuilder.New(salome.myStudy)
    +smesh = smeshBuilder.New()
     
     you also need to modify some lines where smeshBuilder is used instead of smesh
     
    diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py
    index 88d2b0b1a..233432117 100644
    --- a/src/SMESH_SWIG/smeshBuilder.py
    +++ b/src/SMESH_SWIG/smeshBuilder.py
    @@ -189,13 +189,8 @@ def GetName(obj):
             except:
                 ior = None
             if ior:
    -            # CORBA object
    -            studies = salome.myStudyManager.GetOpenStudies()
    -            for sname in studies:
    -                s = salome.myStudyManager.GetStudyByName(sname)
    -                if not s: continue
    -                sobj = s.FindObjectIOR(ior)
    -                if not sobj: continue
    +            sobj = salome.myStudy.FindObjectIOR(ior)
    +            if sobj:
                     return sobj.GetName()
                 if hasattr(obj, "GetName"):
                     # unknown CORBA object, having GetName() method
    @@ -266,12 +261,7 @@ def TreatHypoStatus(status, hypName, geomName, isAlgo, mesh):
     def AssureGeomPublished(mesh, geom, name=''):
         if not isinstance( geom, geomBuilder.GEOM._objref_GEOM_Object ):
             return
    -    if not geom.GetStudyEntry() and \
    -           mesh.smeshpyD.GetCurrentStudy():
    -        ## set the study
    -        studyID = mesh.smeshpyD.GetCurrentStudy()._get_StudyId()
    -        if studyID != mesh.geompyD.myStudyId:
    -            mesh.geompyD.init_geom( mesh.smeshpyD.GetCurrentStudy())
    +    if not geom.GetStudyEntry():
             ## get a name
             if not name and geom.GetShapeType() != geomBuilder.GEOM.COMPOUND:
                 # for all groups SubShapeName() return "Compound_-1"
    @@ -380,8 +370,8 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
         ## Dump component to the Python script
         #  This method overrides IDL function to allow default values for the parameters.
         #  @ingroup l1_auxiliary
    -    def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
    -        return SMESH._objref_SMESH_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
    +    def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
    +        return SMESH._objref_SMESH_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
     
         ## Set mode of DumpPython(), \a historical or \a snapshot.
         #  In the \a historical mode, the Python Dump script includes all commands
    @@ -394,14 +384,14 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
             else:            val = "false"
             SMESH._objref_SMESH_Gen.SetOption(self, "historical_python_dump", val)
     
    -    ## Set the current study and Geometry component
    +    ## Set Geometry component
         #  @ingroup l1_auxiliary
    -    def init_smesh(self,theStudy,geompyD = None):
    +    def init_smesh(self,isPublished = True,geompyD = None):
             #print "init_smesh"
    -        self.SetCurrentStudy(theStudy,geompyD)
    -        if theStudy:
    +        self.UpdateStudy(geompyD)
    +        if isPublished:
                 global notebook
    -            notebook.myStudy = theStudy
    +            notebook.myStudy = salome.myStudy
     
         ## Create a mesh. This can be either an empty mesh, possibly having an underlying geometry,
         #  or a mesh wrapping a CORBA mesh given as a parameter.
    @@ -523,34 +513,32 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
         #  @ingroup l1_auxiliary
         def IsEmbeddedMode(self):
             return SMESH._objref_SMESH_Gen.IsEmbeddedMode(self)
    -
    -    ## Set the current study. Calling SetCurrentStudy( None ) allows to
    -    #  switch OFF automatic pubilishing in the Study of mesh objects.
    +    
    +    ## Update the current study. Calling UpdateStudy() allows to 
    +    #  update meshes at switching GEOM->SMESH
         #  @ingroup l1_auxiliary
    -    def SetCurrentStudy( self, theStudy, geompyD = None ):
    +    def UpdateStudy( self, geompyD = None  ):
    +        #self.UpdateStudy()
             if not geompyD:
                 from salome.geom import geomBuilder
                 geompyD = geomBuilder.geom
                 pass
             self.geompyD=geompyD
             self.SetGeomEngine(geompyD)
    -        SMESH._objref_SMESH_Gen.SetCurrentStudy(self,theStudy)
    -        global notebook
    -        if theStudy:
    -            notebook = salome_notebook.NoteBook( theStudy )
    -        else:
    -            notebook = salome_notebook.NoteBook( salome_notebook.PseudoStudyForNoteBook() )
    -        if theStudy:
    -            sb = theStudy.NewBuilder()
    -            sc = theStudy.FindComponent("SMESH")
    -            if sc: sb.LoadWith(sc, self)
    -            pass
    +        SMESH._objref_SMESH_Gen.UpdateStudy(self)
    +        sb = salome.myStudy.NewBuilder()
    +        sc = salome.myStudy.FindComponent("SMESH")
    +        if sc: sb.LoadWith(sc, self)
             pass
    -
    -    ## Get the current study
    +        
    +    ## Sets enable publishing in the study. Calling SetEnablePublish( false ) allows to
    +    #  switch OFF publishing in the Study of mesh objects.
         #  @ingroup l1_auxiliary
    -    def GetCurrentStudy(self):
    -        return SMESH._objref_SMESH_Gen.GetCurrentStudy(self)
    +    def SetEnablePublish( self, theIsEnablePublish ):
    +        #self.SetEnablePublish(theIsEnablePublish)
    +        SMESH._objref_SMESH_Gen.SetEnablePublish(self,theIsEnablePublish)
    +        global notebook
    +        notebook = salome_notebook.NoteBook( theIsEnablePublish )
     
         ## Create a Mesh object importing data from the given UNV file
         #  @return an instance of Mesh class
    @@ -760,7 +748,7 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
                         raise ValueError, "Group type mismatches Element type"
                     aCriterion.ThresholdStr = aThreshold.GetName()
                     aCriterion.ThresholdID  = salome.orb.object_to_string( aThreshold )
    -                study = self.GetCurrentStudy()
    +                study = salome.myStudy
                     if study:
                         so = study.FindObjectIOR( aCriterion.ThresholdID )
                         if so:
    @@ -1167,13 +1155,13 @@ omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshBuilder)
     #    import salome
     #    salome.salome_init()
     #    from salome.smesh import smeshBuilder
    -#    smesh = smeshBuilder.New(salome.myStudy)
    +#    smesh = smeshBuilder.New()
     #  \endcode
    -#  @param  study     SALOME study, generally obtained by salome.myStudy.
    +#  @param  isPublished If False, the notebool will not be used.
     #  @param  instance  CORBA proxy of SMESH Engine. If None, the default Engine is used.
     #  @return smeshBuilder instance
     
    -def New( study, instance=None):
    +def New( isPublished = True, instance=None):
         """
         Create a new smeshBuilder instance.The smeshBuilder class provides the Python
         interface to create or load meshes.
    @@ -1182,10 +1170,10 @@ def New( study, instance=None):
             import salome
             salome.salome_init()
             from salome.smesh import smeshBuilder
    -        smesh = smeshBuilder.New(salome.myStudy)
    +        smesh = smeshBuilder.New()
     
         Parameters:
    -        study     SALOME study, generally obtained by salome.myStudy.
    +        isPublished If False, the notebool will not be used.
             instance  CORBA proxy of SMESH Engine. If None, the default Engine is used.
         Returns:
             smeshBuilder instance
    @@ -1198,7 +1186,7 @@ def New( study, instance=None):
           doLcc = True
         smeshInst = smeshBuilder()
         assert isinstance(smeshInst,smeshBuilder), "Smesh engine class is %s but should be smeshBuilder.smeshBuilder. Import salome.smesh.smeshBuilder before creating the instance."%smeshInst.__class__
    -    smeshInst.init_smesh(study)
    +    smeshInst.init_smesh(isPublished)
         return smeshInst
     
     
    @@ -1237,12 +1225,9 @@ class Mesh:
                     self.geom = obj
                     objHasName = True
                     # publish geom of mesh (issue 0021122)
    -                if not self.geom.GetStudyEntry() and smeshpyD.GetCurrentStudy():
    +                if not self.geom.GetStudyEntry():
                         objHasName = False
    -                    studyID = smeshpyD.GetCurrentStudy()._get_StudyId()
    -                    if studyID != geompyD.myStudyId:
    -                        geompyD.init_geom( smeshpyD.GetCurrentStudy())
    -                        pass
    +                    geompyD.init_geom()
                         if name:
                             geo_name = name + " shape"
                         else:
    @@ -1519,12 +1504,12 @@ class Mesh:
                     print msg
                     print allReasons
                 pass
    -        if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
    +        if salome.sg.hasDesktop():
                 if not isinstance( refresh, list): # not a call from subMesh.Compute()
                     smeshgui = salome.ImportComponentGUI("SMESH")
    -                smeshgui.Init(self.mesh.GetStudyId())
    +                smeshgui.Init()
                     smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok, (self.NbNodes()==0) )
    -                if refresh: salome.sg.updateObjBrowser(True)
    +                if refresh: salome.sg.updateObjBrowser()
     
             return ok
     
    @@ -1549,11 +1534,9 @@ class Mesh:
             try:
                 shapeText = ""
                 mainIOR  = salome.orb.object_to_string( self.GetShape() )
    -            for sname in salome.myStudyManager.GetOpenStudies():
    -                s = salome.myStudyManager.GetStudyByName(sname)
    -                if not s: continue
    -                mainSO = s.FindObjectIOR(mainIOR)
    -                if not mainSO: continue
    +            s = salome.myStudy
    +            mainSO = s.FindObjectIOR(mainIOR)
    +            if mainSO:
                     if subShapeID == 1:
                         shapeText = '"%s"' % mainSO.GetName()
                     subIt = s.NewChildIterator(mainSO)
    @@ -1570,7 +1553,6 @@ class Mesh:
                             continue
                         if ids == subShapeID:
                             shapeText = '"%s"' % subSO.GetName()
    -                        break
                 if not shapeText:
                     shape = self.geompyD.GetSubShape( self.GetShape(), [subShapeID])
                     if shape:
    @@ -1641,12 +1623,11 @@ class Mesh:
         #  @ingroup l2_construct
         def Clear(self, refresh=False):
             self.mesh.Clear()
    -        if ( salome.sg.hasDesktop() and 
    -             salome.myStudyManager.GetStudyByID( self.mesh.GetStudyId() ) ):
    +        if ( salome.sg.hasDesktop() ):
                 smeshgui = salome.ImportComponentGUI("SMESH")
    -            smeshgui.Init(self.mesh.GetStudyId())
    +            smeshgui.Init()
                 smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
    -            if refresh: salome.sg.updateObjBrowser(True)
    +            if refresh: salome.sg.updateObjBrowser()
     
         ## Remove all nodes and elements of indicated shape
         #  @param refresh if @c True, Object browser is automatically updated (when running in GUI)
    @@ -1656,9 +1637,9 @@ class Mesh:
             self.mesh.ClearSubMesh(geomId)
             if salome.sg.hasDesktop():
                 smeshgui = salome.ImportComponentGUI("SMESH")
    -            smeshgui.Init(self.mesh.GetStudyId())
    +            smeshgui.Init()
                 smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
    -            if refresh: salome.sg.updateObjBrowser(True)
    +            if refresh: salome.sg.updateObjBrowser()
     
         ## Compute a tetrahedral mesh using AutomaticLength + MEFISTO + Tetrahedron
         #  @param fineness [0.0,1.0] defines mesh fineness
    @@ -2259,12 +2240,6 @@ class Mesh:
         def GetId(self):
             return self.mesh.GetId()
     
    -    ## Get the study Id
    -    #  @return integer value, which is the study Id of the mesh
    -    #  @ingroup l1_auxiliary
    -    def GetStudyId(self):
    -        return self.mesh.GetStudyId()
    -
         ## Check the group names for duplications.
         #  Consider the maximum group name length stored in MED file.
         #  @return True or False
    @@ -5094,11 +5069,11 @@ class submeshProxy(SMESH._objref_SMESH_subMesh):
     
             ok = self.mesh.Compute( self.GetSubShape(),refresh=[] )
     
    -        if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
    +        if salome.sg.hasDesktop():
                 smeshgui = salome.ImportComponentGUI("SMESH")
    -            smeshgui.Init(self.mesh.GetStudyId())
    +            smeshgui.Init()
                 smeshgui.SetMeshIcon( salome.ObjectToID( self ), ok, (self.GetNumberOfElements()==0) )
    -            if refresh: salome.sg.updateObjBrowser(True)
    +            if refresh: salome.sg.updateObjBrowser()
                 pass
     
             return ok
    diff --git a/src/SMESH_SWIG/smesh_algorithm.py b/src/SMESH_SWIG/smesh_algorithm.py
    index 3690f76d8..bc2489436 100644
    --- a/src/SMESH_SWIG/smesh_algorithm.py
    +++ b/src/SMESH_SWIG/smesh_algorithm.py
    @@ -70,7 +70,7 @@ class Mesh_Algorithm:
         #  Finds only the hypotheses created in smeshpyD engine.
         #  @return SMESH.SMESH_Hypothesis
         def FindHypothesis (self, hypname, args, CompareMethod, smeshpyD):
    -        study = smeshpyD.GetCurrentStudy()
    +        study = salome.myStudy
             if not study: return None
             #to do: find component by smeshpyD object, not by its data type
             scomp = study.FindComponent(smeshpyD.ComponentDataType())
    @@ -114,7 +114,7 @@ class Mesh_Algorithm:
         #  Finds only the algorithms, which have been created in smeshpyD engine.
         #  @return SMESH.SMESH_Algo
         def FindAlgorithm (self, algoname, smeshpyD):
    -        study = smeshpyD.GetCurrentStudy()
    +        study = salome.myStudy
             if not study: return None
             #to do: find component by smeshpyD object, not by its data type
             scomp = study.FindComponent(smeshpyD.ComponentDataType())
    diff --git a/src/SMESH_SWIG/smesh_selection.py b/src/SMESH_SWIG/smesh_selection.py
    index 882188089..b2e06bf1f 100644
    --- a/src/SMESH_SWIG/smesh_selection.py
    +++ b/src/SMESH_SWIG/smesh_selection.py
    @@ -28,7 +28,7 @@ sm_gui = libSMESH_Swig.SMESH_Swig()
     
     import SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
    -smesh =  smeshBuilder.New(salome.myStudy)
    +smesh =  smeshBuilder.New()
     
     import GEOM
     
    diff --git a/src/SMESH_SWIG_WITHIHM/CMakeLists.txt b/src/SMESH_SWIG_WITHIHM/CMakeLists.txt
    index 8a252507c..ba8341161 100644
    --- a/src/SMESH_SWIG_WITHIHM/CMakeLists.txt
    +++ b/src/SMESH_SWIG_WITHIHM/CMakeLists.txt
    @@ -52,6 +52,7 @@ ADD_DEFINITIONS(
     SET(_link_LIBRARIES
       ${KERNEL_SalomeGenericObj}
       ${KERNEL_SALOMELocalTrace}
    +  ${KERNEL_SalomeKernelHelpers}
       ${GUI_CAM}
       ${GUI_suit}
       ${GUI_qtx}
    diff --git a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx
    index 231dd33b5..4d7bb2ae1 100644
    --- a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx
    +++ b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx
    @@ -35,6 +35,7 @@
     #include 
     #include 
     #include 
    +#include 
     
     #include 
     
    @@ -202,14 +203,13 @@ namespace
       void
       SetDomain(const char*                       theMeshOrSubMeshEntry,
                 const char*                       theDomainEntry,
    -            const SALOMEDS::Study_var&        theStudy,
                 const SALOMEDS::StudyBuilder_var& theStudyBuilder,
                 long                              theRefOnAppliedDomainTag,
                 const QString&                    theAppliedDomainMEN,
                 const QString&                    theAppliedDomainICON)
       {
    -    SALOMEDS::SObject_var aMeshOrSubMeshSO = theStudy->FindObjectID(theMeshOrSubMeshEntry);
    -    SALOMEDS::SObject_var    aHypothesisSO = theStudy->FindObjectID(theDomainEntry);
    +    SALOMEDS::SObject_var aMeshOrSubMeshSO = KERNEL::getStudyServant()->FindObjectID(theMeshOrSubMeshEntry);
    +    SALOMEDS::SObject_var    aHypothesisSO = KERNEL::getStudyServant()->FindObjectID(theDomainEntry);
     
         if(!aMeshOrSubMeshSO->_is_nil() && !aHypothesisSO->_is_nil()){
           //Find or Create Applied Hypothesis root
    @@ -245,12 +245,10 @@ namespace
       void
       SetHypothesis(const char*                       theMeshOrSubMeshEntry,
                     const char*                       theDomainEntry,
    -                const SALOMEDS::Study_var&        theStudy,
                     const SALOMEDS::StudyBuilder_var& theStudyBuilder)
       {
         SetDomain(theMeshOrSubMeshEntry,
                   theDomainEntry,
    -              theStudy,
                   theStudyBuilder,
                   SMESH::Tag_RefOnAppliedHypothesis,
                   QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
    @@ -262,12 +260,10 @@ namespace
       void
       SetAlgorithms(const char*                       theMeshOrSubMeshEntry,
                     const char*                       theDomainEntry,
    -                const SALOMEDS::Study_var&        theStudy,
                     const SALOMEDS::StudyBuilder_var& theStudyBuilder)
       {
         SetDomain(theMeshOrSubMeshEntry,
                   theDomainEntry,
    -              theStudy,
                   theStudyBuilder,
                   SMESH::Tag_RefOnAppliedAlgorithms,
                   QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
    @@ -313,21 +309,15 @@ SMESH_Swig::SMESH_Swig()
     
     //===============================================================
     void
    -SMESH_Swig::Init(int theStudyID)
    +SMESH_Swig::Init()
     {
       class TEvent: public SALOME_Event
       {
    -    int                         myStudyID;
    -    SALOMEDS::Study_var&        myStudy;
         SALOMEDS::StudyBuilder_var& myStudyBuilder;
         SALOMEDS::SComponent_var&   mySComponentMesh;
       public:
    -    TEvent(int                         theStudyID,
    -           SALOMEDS::Study_var&        theStudy,
    -           SALOMEDS::StudyBuilder_var& theStudyBuilder,
    +    TEvent(SALOMEDS::StudyBuilder_var& theStudyBuilder,
                SALOMEDS::SComponent_var&   theSComponentMesh):
    -      myStudyID       (theStudyID),
    -      myStudy         (theStudy),
           myStudyBuilder  (theStudyBuilder),
           mySComponentMesh(theSComponentMesh)
         {}
    @@ -345,26 +335,22 @@ SMESH_Swig::Init(int theStudyID)
           SUIT_Application* anApplication = aSession->activeApplication();
           SalomeApp_Application* anApp    = dynamic_cast(anApplication);
     
    -      SALOME_NamingService* aNamingService = anApp->namingService();
    -      CORBA::Object_var anObject           = aNamingService->Resolve("/myStudyManager");
    -      SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
    -      myStudy = aStudyMgr->GetStudyByID(myStudyID);
    +      SALOMEDS::Study_var aStudy = KERNEL::getStudyServant();
     
           SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
    -      aSMESHGen->SetCurrentStudy( myStudy.in() );
     
    -      myStudyBuilder = myStudy->NewBuilder();
    +      myStudyBuilder = aStudy->NewBuilder();
     
           SALOMEDS::GenericAttribute_var anAttr;
           SALOMEDS::AttributeName_var    aName;
           SALOMEDS::AttributePixMap_var  aPixmap;
     
    -      SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
    +      SALOMEDS::SComponent_var aSComponent = aStudy->FindComponent("SMESH");
           if ( aSComponent->_is_nil() )
           {
    -        bool aLocked = myStudy->GetProperties()->IsLocked();
    +        bool aLocked = aStudy->GetProperties()->IsLocked();
             if (aLocked)
    -          myStudy->GetProperties()->SetLocked(false);
    +          aStudy->GetProperties()->SetLocked(false);
     
             SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI();
             //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
    @@ -387,13 +373,13 @@ SMESH_Swig::Init(int theStudyID)
             aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
             aPixmap->UnRegister();
     
    -        SALOMEDS::UseCaseBuilder_var useCaseBuilder = myStudy->GetUseCaseBuilder();
    +        SALOMEDS::UseCaseBuilder_var useCaseBuilder = KERNEL::getStudyServant()->GetUseCaseBuilder();
             useCaseBuilder->SetRootCurrent();
             useCaseBuilder->Append( aSComponent.in() );
       
             myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
             if (aLocked)
    -          myStudy->GetProperties()->SetLocked(true);
    +          KERNEL::getStudyServant()->GetProperties()->SetLocked(true);
           }
     
           mySComponentMesh = SALOMEDS::SComponent::_narrow(aSComponent);
    @@ -404,9 +390,7 @@ SMESH_Swig::Init(int theStudyID)
     
       //MESSAGE("Init");
     
    -  ProcessVoidEvent(new TEvent(theStudyID,
    -                              myStudy,
    -                              myStudyBuilder,
    +  ProcessVoidEvent(new TEvent(myStudyBuilder,
                                   mySComponentMesh));
     }
     
    @@ -423,7 +407,7 @@ const char* SMESH_Swig::AddNewMesh(const char* theIOR)
     {
     
       // VSR: added temporarily - to be removed - objects are published automatically by engine
    -  SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR);
    +  SALOMEDS::SObject_var aSObject = KERNEL::getStudyServant()->FindObjectIOR(theIOR);
       if (aSObject->_is_nil())
       {
         //Find or Create Hypothesis root
    @@ -482,8 +466,8 @@ const char* SMESH_Swig::AddNewAlgorithms(const char* theIOR)
     void SMESH_Swig::SetShape(const char* theShapeEntry,
                               const char* theMeshEntry)
     {
    -  SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID( theShapeEntry );
    -  SALOMEDS::SObject_var      aMeshSO = myStudy->FindObjectID( theMeshEntry );
    +  SALOMEDS::SObject_var aGeomShapeSO = KERNEL::getStudyServant()->FindObjectID( theShapeEntry );
    +  SALOMEDS::SObject_var      aMeshSO = KERNEL::getStudyServant()->FindObjectID( theMeshEntry );
     
       if(!aMeshSO->_is_nil() && !aGeomShapeSO->_is_nil()){
         SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO, SMESH::Tag_RefOnShape);
    @@ -501,7 +485,6 @@ void SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
     {
       ::SetHypothesis(theMeshOrSubMeshEntry,
                       theDomainEntry,
    -                  myStudy,
                       myStudyBuilder);
     }
     
    @@ -512,7 +495,6 @@ void SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
     {
       ::SetAlgorithms(theMeshOrSubMeshEntry,
                       theDomainEntry,
    -                  myStudy,
                       myStudyBuilder);
     }
     
    @@ -521,7 +503,7 @@ void SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
     void
     SMESH_Swig::UnSetHypothesis(const char* theDomainEntry)
     {
    -  SALOMEDS::SObject_var aDomainSO = myStudy->FindObjectID(theDomainEntry);
    +  SALOMEDS::SObject_var aDomainSO = KERNEL::getStudyServant()->FindObjectID(theDomainEntry);
       if(!aDomainSO->_is_nil())
         myStudyBuilder->RemoveObject(aDomainSO);
     }
    @@ -530,7 +512,7 @@ const char* SMESH_Swig::AddSubMesh(const char* theMeshEntry,
                                        const char* theSubMeshIOR,
                                        int theShapeType)
     {
    -  SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry);
    +  SALOMEDS::SObject_var aMeshSO = KERNEL::getStudyServant()->FindObjectID(theMeshEntry);
       if(!aMeshSO->_is_nil()) {
         long aShapeTag;
         QString aSubMeshName;
    @@ -593,11 +575,11 @@ const char* SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry,
                                               const char* theSubMeshIOR,
                                               int         ShapeType)
     {
    -  SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID(theGeomShapeEntry);
    +  SALOMEDS::SObject_var aGeomShapeSO = KERNEL::getStudyServant()->FindObjectID(theGeomShapeEntry);
       if(!aGeomShapeSO->_is_nil())
       {
         const char *       aSubMeshEntry = AddSubMesh(theMeshEntry,theSubMeshIOR,ShapeType);
    -    SALOMEDS::SObject_var aSubMeshSO = myStudy->FindObjectID(aSubMeshEntry);
    +    SALOMEDS::SObject_var aSubMeshSO = KERNEL::getStudyServant()->FindObjectID(aSubMeshEntry);
         if ( !aSubMeshSO->_is_nil()) {
           SetShape( theGeomShapeEntry, aSubMeshEntry );
           CORBA::String_var aString = aSubMeshSO->GetID();
    @@ -818,7 +800,7 @@ void SMESH_Swig::EraseActor( const char* Mesh_Entry, const bool allViewers )
     void SMESH_Swig::SetName(const char* theEntry,
                              const char* theName)
     {
    -  SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(theEntry);
    +  SALOMEDS::SObject_var aSObject = KERNEL::getStudyServant()->FindObjectID(theEntry);
       SALOMEDS::GenericAttribute_var anAttr;
       SALOMEDS::AttributeName_var aName;
       if(!aSObject->_is_nil()){
    @@ -844,15 +826,12 @@ void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
     {
       class TEvent: public SALOME_Event
       {
    -    SALOMEDS::Study_var myStudy;
         std::string         myMeshEntry;
         bool                myIsComputed, myIsEmpty;
       public:
    -    TEvent(const SALOMEDS::Study_var& theStudy,
    -           const std::string&         theMeshEntry,
    +    TEvent(const std::string&         theMeshEntry,
                const bool                 theIsComputed,
                const bool                 isEmpty):
    -      myStudy     (theStudy),
           myMeshEntry (theMeshEntry),
           myIsComputed(theIsComputed),
           myIsEmpty   (isEmpty)
    @@ -862,15 +841,14 @@ void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
         void
         Execute()
         {
    -      SALOMEDS::SObject_ptr aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str());
    +      SALOMEDS::SObject_ptr aMeshSO = KERNEL::getStudyServant()->FindObjectID(myMeshEntry.c_str());
           if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
             SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
           // aMeshSO->UnRegister();  ~aMesh() already called UnRegister()!
         }
       };
     
    -  ProcessVoidEvent(new TEvent(myStudy,
    -                              theMeshEntry,
    +  ProcessVoidEvent(new TEvent(theMeshEntry,
                                   theIsComputed,
                                   isEmpty));
     }
    diff --git a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h
    index 86682ff5b..ae0f32dcf 100644
    --- a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h
    +++ b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.h
    @@ -95,7 +95,7 @@ public:
       SMESH_Swig();
       ~SMESH_Swig();
         
    -  void                       Init( int );
    +  void                       Init();
     
       const char*                AddNewMesh( const char* );
     
    @@ -134,7 +134,6 @@ public:
       void select( const char *id, int id1, bool append = false );
     
     private:
    -  SALOMEDS::Study_var        myStudy;
       SALOMEDS::StudyBuilder_var myStudyBuilder;
       SALOMEDS::SComponent_var   mySComponentMesh;
     };
    diff --git a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.i b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.i
    index ac732d467..fa59fbeaa 100644
    --- a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.i
    +++ b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.i
    @@ -105,7 +105,7 @@ class SMESH_Swig
       SMESH_Swig();
       ~SMESH_Swig();
     
    -  void Init(int studyID);
    +  void Init();
     
       const char* AddNewMesh(const char* IOR);
       const char* AddNewHypothesis(const char* IOR);
    diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx
    index ba2e031ac..8d9824902 100644
    --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx
    +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx
    @@ -155,7 +155,7 @@ namespace // internal utils
       class AdaptiveAlgo : public StdMeshers_Regular_1D
       {
       public:
    -    AdaptiveAlgo(int hypId, int studyId, SMESH_Gen* gen);
    +    AdaptiveAlgo(int hypId, SMESH_Gen* gen);
         virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape );
         virtual bool Evaluate(SMESH_Mesh &         theMesh,
                               const TopoDS_Shape & theShape,
    @@ -916,9 +916,8 @@ namespace // internal utils
     //function : StdMeshers_Adaptive1D
     //purpose  : Constructor
     StdMeshers_Adaptive1D::StdMeshers_Adaptive1D(int         hypId,
    -                                             int         studyId,
                                                  SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen)
    +  :SMESH_Hypothesis(hypId, gen)
     {
       myMinSize       = 1e-10;
       myMaxSize       = 1e+10;
    @@ -1076,7 +1075,7 @@ SMESH_Algo* StdMeshers_Adaptive1D::GetAlgo() const
       if ( !myAlgo )
       {
         AdaptiveAlgo* newAlgo = 
    -      new AdaptiveAlgo( _gen->GetANewId(), _studyId, _gen );
    +      new AdaptiveAlgo( _gen->GetANewId(), _gen );
         newAlgo->SetHypothesis( this );
     
         ((StdMeshers_Adaptive1D*) this)->myAlgo = newAlgo;
    @@ -1091,9 +1090,8 @@ SMESH_Algo* StdMeshers_Adaptive1D::GetAlgo() const
     //================================================================================
     
     AdaptiveAlgo::AdaptiveAlgo(int        hypId,
    -                           int        studyId,
                                SMESH_Gen* gen)
    -  : StdMeshers_Regular_1D( hypId, studyId, gen ),
    +  : StdMeshers_Regular_1D( hypId, gen ),
         myHyp(NULL)
     {
       _name = "AdaptiveAlgo_1D";
    diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.hxx b/src/StdMeshers/StdMeshers_Adaptive1D.hxx
    index 601aeae0b..39ea38e87 100644
    --- a/src/StdMeshers/StdMeshers_Adaptive1D.hxx
    +++ b/src/StdMeshers/StdMeshers_Adaptive1D.hxx
    @@ -37,7 +37,7 @@
     class STDMESHERS_EXPORT StdMeshers_Adaptive1D : public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_Adaptive1D(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_Adaptive1D(int hypId, SMESH_Gen * gen);
       ~StdMeshers_Adaptive1D();
     
       /*!
    diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx
    index a06202a8e..629ade75f 100644
    --- a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx
    +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx
    @@ -48,8 +48,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(int hypId, SMESH_Gen * gen)
    +  :SMESH_Hypothesis(hypId, gen)
     {
       _begLength = 1.;
       _endLength = 10.;
    diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.hxx b/src/StdMeshers/StdMeshers_Arithmetic1D.hxx
    index 870589752..7dd89459b 100644
    --- a/src/StdMeshers/StdMeshers_Arithmetic1D.hxx
    +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.hxx
    @@ -41,7 +41,7 @@ class STDMESHERS_EXPORT StdMeshers_Arithmetic1D:
       public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_Arithmetic1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Arithmetic1D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_Arithmetic1D();
     
       void SetLength(double length, bool isStartLength) throw(SALOME_Exception);
    diff --git a/src/StdMeshers/StdMeshers_AutomaticLength.cxx b/src/StdMeshers/StdMeshers_AutomaticLength.cxx
    index ad5f5263f..f3fb2428f 100644
    --- a/src/StdMeshers/StdMeshers_AutomaticLength.cxx
    +++ b/src/StdMeshers/StdMeshers_AutomaticLength.cxx
    @@ -47,8 +47,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_AutomaticLength::StdMeshers_AutomaticLength(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_AutomaticLength::StdMeshers_AutomaticLength(int hypId, SMESH_Gen * gen)
    +  :SMESH_Hypothesis(hypId, gen)
     {
       _name = "AutomaticLength";
       _param_algo_dim = 1; // is used by SMESH_Regular_1D
    diff --git a/src/StdMeshers/StdMeshers_AutomaticLength.hxx b/src/StdMeshers/StdMeshers_AutomaticLength.hxx
    index 2e30f8c10..f9188e374 100644
    --- a/src/StdMeshers/StdMeshers_AutomaticLength.hxx
    +++ b/src/StdMeshers/StdMeshers_AutomaticLength.hxx
    @@ -49,7 +49,7 @@ class TopoDS_TShape;
     class STDMESHERS_EXPORT StdMeshers_AutomaticLength:public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_AutomaticLength(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_AutomaticLength(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_AutomaticLength();
     
       /*!
    diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx
    index f55687ca3..ea5f440cc 100644
    --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx
    +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx
    @@ -61,9 +61,8 @@ using namespace std;
     //=======================================================================
     
     StdMeshers_CartesianParameters3D::StdMeshers_CartesianParameters3D(int         hypId,
    -                                                                   int         studyId,
                                                                        SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen),
    +  : SMESH_Hypothesis(hypId, gen),
         _sizeThreshold( 4.0 ), // default according to the customer specification
         _toAddEdges( false )
     {
    diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.hxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.hxx
    index f87cd346b..e5ef065cc 100644
    --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.hxx
    +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.hxx
    @@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_CartesianParameters3D:  public SMESH_Hypothes
     {
     public:
       // Constructor
    -  StdMeshers_CartesianParameters3D( int hypId, int studyId, SMESH_Gen * gen );
    +  StdMeshers_CartesianParameters3D( int hypId, SMESH_Gen * gen );
     
       /*!
        * Sets coordinates of node positions along an axis (countered from 0)
    diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx
    index aebd779ee..4220d7d18 100644
    --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx
    +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx
    @@ -108,8 +108,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_3D_Algo(hypId, studyId, gen)
    +StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(int hypId, SMESH_Gen * gen)
    +  :SMESH_3D_Algo(hypId, gen)
     {
       _name = "Cartesian_3D";
       _shapeType = (1 << TopAbs_SOLID);       // 1 bit /shape type
    diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.hxx b/src/StdMeshers/StdMeshers_Cartesian_3D.hxx
    index 2cc485501..91e058712 100644
    --- a/src/StdMeshers/StdMeshers_Cartesian_3D.hxx
    +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.hxx
    @@ -41,7 +41,7 @@ class StdMeshers_CartesianParameters3D;
     class STDMESHERS_EXPORT StdMeshers_Cartesian_3D : public SMESH_3D_Algo
     {
     public:
    -  StdMeshers_Cartesian_3D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Cartesian_3D(int hypId, SMESH_Gen* gen);
     
       virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
                                    const TopoDS_Shape& aShape,
    diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
    index d80d072a9..431de7ef9 100644
    --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
    +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
    @@ -267,8 +267,8 @@ private:
      */
     //================================================================================
     
    -StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_3D_Algo(hypId, studyId, gen)
    +StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, SMESH_Gen* gen)
    +  :SMESH_3D_Algo(hypId, gen)
     {
       _name = "CompositeHexa_3D";
       _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);       // 1 bit /shape type
    diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx
    index f1082b73f..0b8e8f80d 100644
    --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx
    +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.hxx
    @@ -42,7 +42,7 @@ struct _QuadFaceGrid;
     class STDMESHERS_EXPORT StdMeshers_CompositeHexa_3D: public SMESH_3D_Algo
     {
     public:
    -  StdMeshers_CompositeHexa_3D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_CompositeHexa_3D(int hypId, SMESH_Gen* gen);
       //virtual ~StdMeshers_CompositeHexa_3D();
     
       virtual bool Compute(SMESH_Mesh&         aMesh,
    diff --git a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx
    index 9a66a5633..3992bc81a 100644
    --- a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx
    +++ b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx
    @@ -243,9 +243,8 @@ namespace {
     //=============================================================================
     
     StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D(int         hypId,
    -                                                               int         studyId,
                                                                    SMESH_Gen * gen)
    -  :StdMeshers_Regular_1D(hypId, studyId, gen)
    +  :StdMeshers_Regular_1D(hypId, gen)
     {
       _name = AlgoName();
     }
    diff --git a/src/StdMeshers/StdMeshers_CompositeSegment_1D.hxx b/src/StdMeshers/StdMeshers_CompositeSegment_1D.hxx
    index 5380a65f5..86436bd18 100644
    --- a/src/StdMeshers/StdMeshers_CompositeSegment_1D.hxx
    +++ b/src/StdMeshers/StdMeshers_CompositeSegment_1D.hxx
    @@ -39,7 +39,7 @@ class TopoDS_Face;
     class STDMESHERS_EXPORT StdMeshers_CompositeSegment_1D: public StdMeshers_Regular_1D
     {
     public:
    -  StdMeshers_CompositeSegment_1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_CompositeSegment_1D(int hypId, SMESH_Gen* gen);
     
       virtual bool Compute(SMESH_Mesh&         aMesh,
                            const TopoDS_Shape& aShape);
    diff --git a/src/StdMeshers/StdMeshers_Deflection1D.cxx b/src/StdMeshers/StdMeshers_Deflection1D.cxx
    index 6181e8cbf..2db55f223 100644
    --- a/src/StdMeshers/StdMeshers_Deflection1D.cxx
    +++ b/src/StdMeshers/StdMeshers_Deflection1D.cxx
    @@ -50,9 +50,8 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Deflection1D::StdMeshers_Deflection1D(int         hypId,
    -                                                 int         studyId,
                                                      SMESH_Gen * gen)
    -     :SMESH_Hypothesis(hypId, studyId, gen)
    +     :SMESH_Hypothesis(hypId, gen)
     {
       _value = 1.;
       _name = "Deflection1D";
    diff --git a/src/StdMeshers/StdMeshers_Deflection1D.hxx b/src/StdMeshers/StdMeshers_Deflection1D.hxx
    index 664a4a094..34a2d34ee 100644
    --- a/src/StdMeshers/StdMeshers_Deflection1D.hxx
    +++ b/src/StdMeshers/StdMeshers_Deflection1D.hxx
    @@ -35,7 +35,7 @@
     class STDMESHERS_EXPORT StdMeshers_Deflection1D:public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_Deflection1D(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_Deflection1D(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_Deflection1D();
     
       void SetDeflection(double value) throw(SALOME_Exception);
    diff --git a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx
    index e316cb11a..9f32b2d86 100644
    --- a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx
    +++ b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx
    @@ -35,9 +35,9 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId, int studyId,
    +StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId,
                                                        SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen)
    +  :SMESH_Hypothesis(hypId, gen)
     {
       _name = "FixedPoints1D";
       _param_algo_dim = 1;
    diff --git a/src/StdMeshers/StdMeshers_FixedPoints1D.hxx b/src/StdMeshers/StdMeshers_FixedPoints1D.hxx
    index 4855f0307..f8d8f6a75 100644
    --- a/src/StdMeshers/StdMeshers_FixedPoints1D.hxx
    +++ b/src/StdMeshers/StdMeshers_FixedPoints1D.hxx
    @@ -38,7 +38,7 @@ class STDMESHERS_EXPORT StdMeshers_FixedPoints1D:
       public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_FixedPoints1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_FixedPoints1D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_FixedPoints1D();
     
       void SetPoints(std::vector& listParams)
    diff --git a/src/StdMeshers/StdMeshers_Geometric1D.cxx b/src/StdMeshers/StdMeshers_Geometric1D.cxx
    index 33b091783..b7eafade5 100644
    --- a/src/StdMeshers/StdMeshers_Geometric1D.cxx
    +++ b/src/StdMeshers/StdMeshers_Geometric1D.cxx
    @@ -42,8 +42,8 @@
      */
     //=============================================================================
     
    -StdMeshers_Geometric1D::StdMeshers_Geometric1D(int hypId, int studyId, SMESH_Gen * gen)
    -  :StdMeshers_Reversible1D(hypId, studyId, gen)
    +StdMeshers_Geometric1D::StdMeshers_Geometric1D(int hypId, SMESH_Gen * gen)
    +  :StdMeshers_Reversible1D(hypId, gen)
     {
       _begLength = 1.;
       _ratio = 1.;
    diff --git a/src/StdMeshers/StdMeshers_Geometric1D.hxx b/src/StdMeshers/StdMeshers_Geometric1D.hxx
    index 1dc38b1e2..8810ad985 100644
    --- a/src/StdMeshers/StdMeshers_Geometric1D.hxx
    +++ b/src/StdMeshers/StdMeshers_Geometric1D.hxx
    @@ -35,7 +35,7 @@
     class STDMESHERS_EXPORT StdMeshers_Geometric1D: public StdMeshers_Reversible1D
     {
     public:
    -  StdMeshers_Geometric1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Geometric1D(int hypId, SMESH_Gen* gen);
     
       void SetStartLength(double length) throw(SALOME_Exception);
       void SetCommonRatio(double factor) throw(SALOME_Exception);
    diff --git a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx
    index 12ae7326f..13c897d18 100644
    --- a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx
    +++ b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx
    @@ -1022,8 +1022,8 @@ namespace
     //purpose  : 
     //=======================================================================
     
    -StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_3D_Algo(hypId, studyId, gen)
    +StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(int hypId, SMESH_Gen* gen)
    +  :SMESH_3D_Algo(hypId, gen)
     {
       _name = "HexaFromSkin_3D";
     }
    diff --git a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.hxx b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.hxx
    index d69431977..e530ffeb1 100644
    --- a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.hxx
    +++ b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.hxx
    @@ -34,7 +34,7 @@
     class STDMESHERS_EXPORT StdMeshers_HexaFromSkin_3D : public SMESH_3D_Algo
     {
     public:
    -  StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_HexaFromSkin_3D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_HexaFromSkin_3D();
     
       virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
    diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx
    index 335a36a78..a968121c5 100644
    --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx
    +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx
    @@ -70,8 +70,8 @@ static bool EvaluatePentahedralMesh(SMESH_Mesh &, const TopoDS_Shape &,
      */
     //=============================================================================
     
    -StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_3D_Algo(hypId, studyId, gen)
    +StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, SMESH_Gen * gen)
    +  :SMESH_3D_Algo(hypId, gen)
     {
       _name = "Hexa_3D";
       _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);       // 1 bit /shape type
    @@ -367,7 +367,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
       TopExp::MapShapes( aShape, TopAbs_FACE, FF);
       if ( FF.Extent() != 6)
       {
    -    static StdMeshers_CompositeHexa_3D compositeHexa(_gen->GetANewId(), 0, _gen);
    +    static StdMeshers_CompositeHexa_3D compositeHexa(_gen->GetANewId(), _gen);
         if ( !compositeHexa.Compute( aMesh, aShape ))
           return error( compositeHexa.GetComputeError() );
         return true;
    @@ -377,7 +377,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
       // ---------------------
       
       FaceQuadStructPtr quad[ 6 ];
    -  StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), GetStudyId(), _gen);
    +  StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), _gen);
       for ( int i = 0; i < 6; ++i )
       {
         if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 ),
    @@ -699,7 +699,7 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh,
       }
       if (meshFaces.size() != 6) {
         //return error(COMPERR_BAD_SHAPE, TComm(meshFaces.size())<<" instead of 6 faces in a block");
    -    static StdMeshers_CompositeHexa_3D compositeHexa(-10, 0, aMesh.GetGen());
    +    static StdMeshers_CompositeHexa_3D compositeHexa(-10, aMesh.GetGen());
         return compositeHexa.Evaluate(aMesh, aShape, aResMap);
       }
       
    @@ -809,7 +809,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper
       static StdMeshers_HexaFromSkin_3D * algo = 0;
       if ( !algo ) {
         SMESH_Gen* gen = aMesh.GetGen();
    -    algo = new StdMeshers_HexaFromSkin_3D( gen->GetANewId(), 0, gen );
    +    algo = new StdMeshers_HexaFromSkin_3D( gen->GetANewId(), gen );
       }
       algo->InitComputeError();
       algo->Compute( aMesh, aHelper );
    @@ -877,7 +877,7 @@ SMESH_ComputeErrorPtr ComputePentahedralMesh(SMESH_Mesh &          aMesh,
         static StdMeshers_Prism_3D * aPrism3D = 0;
         if ( !aPrism3D ) {
           SMESH_Gen* gen = aMesh.GetGen();
    -      aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), 0, gen );
    +      aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), gen );
         }
         SMESH_Hypothesis::Hypothesis_Status aStatus;
         if ( aPrism3D->CheckHypothesis( aMesh, aShape, aStatus ) ) {
    @@ -908,7 +908,7 @@ bool EvaluatePentahedralMesh(SMESH_Mesh & aMesh,
         static StdMeshers_Prism_3D * aPrism3D = 0;
         if ( !aPrism3D ) {
           SMESH_Gen* gen = aMesh.GetGen();
    -      aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), 0, gen );
    +      aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), gen );
         }
         SMESH_Hypothesis::Hypothesis_Status aStatus;
         if ( aPrism3D->CheckHypothesis( aMesh, aShape, aStatus ) ) {
    diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.hxx b/src/StdMeshers/StdMeshers_Hexa_3D.hxx
    index 8b50468b7..2f50e330f 100644
    --- a/src/StdMeshers/StdMeshers_Hexa_3D.hxx
    +++ b/src/StdMeshers/StdMeshers_Hexa_3D.hxx
    @@ -40,7 +40,7 @@ class SMESH_MesherHelper;
     class STDMESHERS_EXPORT StdMeshers_Hexa_3D : public SMESH_3D_Algo
     {
     public:
    -  StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Hexa_3D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_Hexa_3D();
     
       virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
    diff --git a/src/StdMeshers/StdMeshers_ImportSource.cxx b/src/StdMeshers/StdMeshers_ImportSource.cxx
    index 0ee9c4b41..b737c5756 100644
    --- a/src/StdMeshers/StdMeshers_ImportSource.cxx
    +++ b/src/StdMeshers/StdMeshers_ImportSource.cxx
    @@ -49,9 +49,8 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_ImportSource1D::StdMeshers_ImportSource1D(int         hypId,
    -                                                     int         studyId,
                                                          SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen),
    +  :SMESH_Hypothesis(hypId, gen),
        _toCopyMesh(false),
        _toCopyGroups(false)
     {
    @@ -66,9 +65,8 @@ StdMeshers_ImportSource1D::StdMeshers_ImportSource1D(int         hypId,
     //=============================================================================
     
     StdMeshers_ImportSource2D::StdMeshers_ImportSource2D(int         hypId,
    -                                                     int         studyId,
                                                          SMESH_Gen * gen)
    -  :StdMeshers_ImportSource1D(hypId, studyId, gen)
    +  :StdMeshers_ImportSource1D(hypId, gen)
     {
       _name = "ImportSource2D";
       _param_algo_dim = 2; // is used by StdMeshers_Import_2D;
    @@ -206,7 +204,7 @@ const std::vector&  StdMeshers_ImportSource1D::GetGroups(bool load
     {
       // filter off deleted groups
       vector okGroups = getValidGroups( _groups,
    -                                                  _gen->GetStudyContext(_studyId),
    +                                                  _gen->GetStudyContext(),
                                                       loaded);
       if ( okGroups.size() != _groups.size() )
         ((StdMeshers_ImportSource1D*)this)->_groups = okGroups;
    @@ -247,7 +245,7 @@ std::vector StdMeshers_ImportSource1D::GetSourceMeshes() const
       vector meshes;
       if ( !meshIDs.empty() )
       {
    -    StudyContextStruct* studyContext = _gen->GetStudyContext(_studyId);
    +    StudyContextStruct* studyContext = _gen->GetStudyContext();
         for ( set::iterator id = meshIDs.begin(); id != meshIDs.end(); ++id )
         {
           map::iterator itm = studyContext->mapMesh.begin();
    @@ -400,7 +398,7 @@ void StdMeshers_ImportSource1D::RestoreGroups(const std::vector& g
         int key1 = _resultGroupsStorage[i++];
         int key2 = _resultGroupsStorage[i++];
         pair resMapKey( key1, key2 );
    -    SMESH_Mesh* mesh = getTgtMeshByKey( resMapKey, _gen->GetStudyContext(_studyId));
    +    SMESH_Mesh* mesh = getTgtMeshByKey( resMapKey, _gen->GetStudyContext());
         // restore mesh ids at least
         _resultGroups.insert( make_pair (resMapKey,vector() )); 
     
    @@ -463,7 +461,7 @@ StdMeshers_ImportSource1D::GetResultGroups(const SMESHDS_Mesh& srcMesh,
       if ( key2groups == _resultGroups.end() )
         return 0;
       vector vec = getValidGroups((*key2groups).second,
    -                                            _gen->GetStudyContext(_studyId) );
    +                                            _gen->GetStudyContext() );
       if ( vec.size() != key2groups->second.size())
         key2groups->second = vec;
     
    diff --git a/src/StdMeshers/StdMeshers_ImportSource.hxx b/src/StdMeshers/StdMeshers_ImportSource.hxx
    index c4d40d005..cb2febf3b 100644
    --- a/src/StdMeshers/StdMeshers_ImportSource.hxx
    +++ b/src/StdMeshers/StdMeshers_ImportSource.hxx
    @@ -48,7 +48,7 @@ class SMESH_subMesh;
     class STDMESHERS_EXPORT StdMeshers_ImportSource1D : public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_ImportSource1D(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_ImportSource1D(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_ImportSource1D();
     
       void SetGroups(const std::vector& groups);
    @@ -95,6 +95,6 @@ private:
     class STDMESHERS_EXPORT StdMeshers_ImportSource2D : public StdMeshers_ImportSource1D
     {
      public:
    -  StdMeshers_ImportSource2D(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_ImportSource2D(int hypId, SMESH_Gen * gen);
     };
     #endif
    diff --git a/src/StdMeshers/StdMeshers_Import_1D.cxx b/src/StdMeshers/StdMeshers_Import_1D.cxx
    index 193448010..61b6cf65b 100644
    --- a/src/StdMeshers/StdMeshers_Import_1D.cxx
    +++ b/src/StdMeshers/StdMeshers_Import_1D.cxx
    @@ -60,8 +60,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_1D_Algo(hypId, studyId, gen), _sourceHyp(0)
    +StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId, SMESH_Gen * gen)
    +  :SMESH_1D_Algo(hypId, gen), _sourceHyp(0)
     {
       _name = "Import_1D";
       _shapeType = (1 << TopAbs_EDGE);
    diff --git a/src/StdMeshers/StdMeshers_Import_1D.hxx b/src/StdMeshers/StdMeshers_Import_1D.hxx
    index 2c0166308..bbd752247 100644
    --- a/src/StdMeshers/StdMeshers_Import_1D.hxx
    +++ b/src/StdMeshers/StdMeshers_Import_1D.hxx
    @@ -39,7 +39,7 @@ class StdMeshers_ImportSource1D;
     class STDMESHERS_EXPORT StdMeshers_Import_1D: public SMESH_1D_Algo
     {
     public:
    -  StdMeshers_Import_1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Import_1D(int hypId, SMESH_Gen* gen);
     
       virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
                                    const TopoDS_Shape& aShape,
    diff --git a/src/StdMeshers/StdMeshers_Import_1D2D.cxx b/src/StdMeshers/StdMeshers_Import_1D2D.cxx
    index 0d4a369e8..e0e2df666 100644
    --- a/src/StdMeshers/StdMeshers_Import_1D2D.cxx
    +++ b/src/StdMeshers/StdMeshers_Import_1D2D.cxx
    @@ -95,8 +95,8 @@ namespace
      */
     //=============================================================================
     
    -StdMeshers_Import_1D2D::StdMeshers_Import_1D2D(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_2D_Algo(hypId, studyId, gen), _sourceHyp(0)
    +StdMeshers_Import_1D2D::StdMeshers_Import_1D2D(int hypId, SMESH_Gen * gen)
    +  :SMESH_2D_Algo(hypId, gen), _sourceHyp(0)
     {
       _name = "Import_1D2D";
       _shapeType = (1 << TopAbs_FACE);
    diff --git a/src/StdMeshers/StdMeshers_Import_1D2D.hxx b/src/StdMeshers/StdMeshers_Import_1D2D.hxx
    index a260f1d2d..8dc16d87e 100644
    --- a/src/StdMeshers/StdMeshers_Import_1D2D.hxx
    +++ b/src/StdMeshers/StdMeshers_Import_1D2D.hxx
    @@ -39,7 +39,7 @@ class StdMeshers_ImportSource1D;
     class STDMESHERS_EXPORT StdMeshers_Import_1D2D: public SMESH_2D_Algo
     {
     public:
    -  StdMeshers_Import_1D2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Import_1D2D(int hypId, SMESH_Gen* gen);
     
       virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
                                    const TopoDS_Shape& aShape,
    diff --git a/src/StdMeshers/StdMeshers_LayerDistribution.cxx b/src/StdMeshers/StdMeshers_LayerDistribution.cxx
    index 05f0b2fd6..8a12ac3d2 100644
    --- a/src/StdMeshers/StdMeshers_LayerDistribution.cxx
    +++ b/src/StdMeshers/StdMeshers_LayerDistribution.cxx
    @@ -40,9 +40,9 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(int hypId, int studyId,
    +StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(int hypId,
                                                                SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _name = "LayerDistribution"; // used by RadialPrism_3D
       _param_algo_dim = 3; // 3D
    diff --git a/src/StdMeshers/StdMeshers_LayerDistribution.hxx b/src/StdMeshers/StdMeshers_LayerDistribution.hxx
    index 8f7fb5e97..7e3fe8384 100644
    --- a/src/StdMeshers/StdMeshers_LayerDistribution.hxx
    +++ b/src/StdMeshers/StdMeshers_LayerDistribution.hxx
    @@ -51,7 +51,7 @@ class STDMESHERS_EXPORT StdMeshers_LayerDistribution:  public SMESH_Hypothesis
     {
     public:
       // Constructor
    -  StdMeshers_LayerDistribution( int hypId, int studyId, SMESH_Gen * gen );
    +  StdMeshers_LayerDistribution( int hypId, SMESH_Gen * gen );
       // Destructor
       virtual ~StdMeshers_LayerDistribution();
     
    diff --git a/src/StdMeshers/StdMeshers_LayerDistribution2D.cxx b/src/StdMeshers/StdMeshers_LayerDistribution2D.cxx
    index 664995684..75cdd43f9 100644
    --- a/src/StdMeshers/StdMeshers_LayerDistribution2D.cxx
    +++ b/src/StdMeshers/StdMeshers_LayerDistribution2D.cxx
    @@ -36,9 +36,8 @@
     //=============================================================================
     
     StdMeshers_LayerDistribution2D::StdMeshers_LayerDistribution2D(int hypId,
    -                                                               int studyId,
                                                                    SMESH_Gen * gen)
    -  : StdMeshers_LayerDistribution(hypId, studyId, gen)
    +  : StdMeshers_LayerDistribution(hypId, gen)
     {
       _name = "LayerDistribution2D"; // used by RadialQuadrangle_1D2D
       _param_algo_dim = 2; // 2D
    diff --git a/src/StdMeshers/StdMeshers_LayerDistribution2D.hxx b/src/StdMeshers/StdMeshers_LayerDistribution2D.hxx
    index 91510d103..704b59f5e 100644
    --- a/src/StdMeshers/StdMeshers_LayerDistribution2D.hxx
    +++ b/src/StdMeshers/StdMeshers_LayerDistribution2D.hxx
    @@ -43,7 +43,7 @@ class STDMESHERS_EXPORT StdMeshers_LayerDistribution2D
     {
     public:
       // Constructor
    -  StdMeshers_LayerDistribution2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_LayerDistribution2D(int hypId, SMESH_Gen* gen);
       // Destructor
       virtual ~StdMeshers_LayerDistribution2D();
     
    diff --git a/src/StdMeshers/StdMeshers_LengthFromEdges.cxx b/src/StdMeshers/StdMeshers_LengthFromEdges.cxx
    index 026d858ae..3bcb1f6e5 100644
    --- a/src/StdMeshers/StdMeshers_LengthFromEdges.cxx
    +++ b/src/StdMeshers/StdMeshers_LengthFromEdges.cxx
    @@ -38,8 +38,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_LengthFromEdges::StdMeshers_LengthFromEdges(int hypId, int studyId, SMESH_Gen* gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_LengthFromEdges::StdMeshers_LengthFromEdges(int hypId, SMESH_Gen* gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _mode =1;
       _name = "LengthFromEdges";
    diff --git a/src/StdMeshers/StdMeshers_LengthFromEdges.hxx b/src/StdMeshers/StdMeshers_LengthFromEdges.hxx
    index 1d210433c..7b7cd162d 100644
    --- a/src/StdMeshers/StdMeshers_LengthFromEdges.hxx
    +++ b/src/StdMeshers/StdMeshers_LengthFromEdges.hxx
    @@ -38,7 +38,7 @@ class STDMESHERS_EXPORT StdMeshers_LengthFromEdges:
       public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_LengthFromEdges(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_LengthFromEdges(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_LengthFromEdges();
     
       void SetMode(int mode)
    diff --git a/src/StdMeshers/StdMeshers_LocalLength.cxx b/src/StdMeshers/StdMeshers_LocalLength.cxx
    index d4ebdfb0a..898d940f4 100644
    --- a/src/StdMeshers/StdMeshers_LocalLength.cxx
    +++ b/src/StdMeshers/StdMeshers_LocalLength.cxx
    @@ -52,8 +52,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_LocalLength::StdMeshers_LocalLength(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_LocalLength::StdMeshers_LocalLength(int hypId, SMESH_Gen * gen)
    +  :SMESH_Hypothesis(hypId, gen)
     {
       _length = 1.;
       _precision = Precision::Confusion();
    diff --git a/src/StdMeshers/StdMeshers_LocalLength.hxx b/src/StdMeshers/StdMeshers_LocalLength.hxx
    index c6de5797b..29f6b166d 100644
    --- a/src/StdMeshers/StdMeshers_LocalLength.hxx
    +++ b/src/StdMeshers/StdMeshers_LocalLength.hxx
    @@ -37,7 +37,7 @@
     class STDMESHERS_EXPORT StdMeshers_LocalLength: public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_LocalLength(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_LocalLength(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_LocalLength();
     
       void SetLength(double length) throw(SALOME_Exception);
    diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx
    index 972d4b12c..50b79a6cc 100644
    --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx
    +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx
    @@ -79,8 +79,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(int hypId, int studyId, SMESH_Gen * gen):
    -  SMESH_2D_Algo(hypId, studyId, gen)
    +StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(int hypId, SMESH_Gen * gen):
    +  SMESH_2D_Algo(hypId, gen)
     {
       _name = "MEFISTO_2D";
       _shapeType = (1 << TopAbs_FACE);
    diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx
    index 3c9d69b9b..bcf22d59e 100644
    --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx
    +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx
    @@ -47,7 +47,7 @@ class StdMeshers_FaceSide;
     class STDMESHERS_EXPORT StdMeshers_MEFISTO_2D: public SMESH_2D_Algo
     {
     public:
    -  StdMeshers_MEFISTO_2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_MEFISTO_2D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_MEFISTO_2D();
     
       virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
    diff --git a/src/StdMeshers/StdMeshers_MaxElementArea.cxx b/src/StdMeshers/StdMeshers_MaxElementArea.cxx
    index 513536da1..77cefa46e 100644
    --- a/src/StdMeshers/StdMeshers_MaxElementArea.cxx
    +++ b/src/StdMeshers/StdMeshers_MaxElementArea.cxx
    @@ -48,8 +48,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_MaxElementArea::StdMeshers_MaxElementArea(int hypId, int studyId, SMESH_Gen* gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_MaxElementArea::StdMeshers_MaxElementArea(int hypId, SMESH_Gen* gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _maxArea =1.;
       _name = "MaxElementArea";
    diff --git a/src/StdMeshers/StdMeshers_MaxElementArea.hxx b/src/StdMeshers/StdMeshers_MaxElementArea.hxx
    index 187c514c1..10de97599 100644
    --- a/src/StdMeshers/StdMeshers_MaxElementArea.hxx
    +++ b/src/StdMeshers/StdMeshers_MaxElementArea.hxx
    @@ -37,7 +37,7 @@
     class STDMESHERS_EXPORT StdMeshers_MaxElementArea:public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_MaxElementArea(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_MaxElementArea(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_MaxElementArea();
     
       void SetMaxArea(double maxArea) throw(SALOME_Exception);
    diff --git a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx
    index 7cdb3e488..86c4f2aa4 100644
    --- a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx
    +++ b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx
    @@ -48,8 +48,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_MaxElementVolume::StdMeshers_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_MaxElementVolume::StdMeshers_MaxElementVolume(int hypId, SMESH_Gen* gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _maxVolume = 1.;
       _name = "MaxElementVolume";
    diff --git a/src/StdMeshers/StdMeshers_MaxElementVolume.hxx b/src/StdMeshers/StdMeshers_MaxElementVolume.hxx
    index 88d0218c9..3ad0e6175 100644
    --- a/src/StdMeshers/StdMeshers_MaxElementVolume.hxx
    +++ b/src/StdMeshers/StdMeshers_MaxElementVolume.hxx
    @@ -38,7 +38,7 @@ class STDMESHERS_EXPORT StdMeshers_MaxElementVolume:
       public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_MaxElementVolume(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_MaxElementVolume();
     
       void SetMaxVolume(double maxVolume)
    diff --git a/src/StdMeshers/StdMeshers_MaxLength.cxx b/src/StdMeshers/StdMeshers_MaxLength.cxx
    index a5774bbc7..7b0d7fbb6 100644
    --- a/src/StdMeshers/StdMeshers_MaxLength.cxx
    +++ b/src/StdMeshers/StdMeshers_MaxLength.cxx
    @@ -47,8 +47,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_MaxLength::StdMeshers_MaxLength(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_MaxLength::StdMeshers_MaxLength(int hypId, SMESH_Gen * gen)
    +  :SMESH_Hypothesis(hypId, gen)
     {
       _length = 1.;
       _preestimated = 0.;
    diff --git a/src/StdMeshers/StdMeshers_MaxLength.hxx b/src/StdMeshers/StdMeshers_MaxLength.hxx
    index 1024d6af5..575bbaafd 100644
    --- a/src/StdMeshers/StdMeshers_MaxLength.hxx
    +++ b/src/StdMeshers/StdMeshers_MaxLength.hxx
    @@ -32,7 +32,7 @@
     class STDMESHERS_EXPORT StdMeshers_MaxLength: public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_MaxLength(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_MaxLength(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_MaxLength();
     
       void SetLength(double length) throw(SALOME_Exception);
    diff --git a/src/StdMeshers/StdMeshers_NotConformAllowed.cxx b/src/StdMeshers/StdMeshers_NotConformAllowed.cxx
    index a3ab8278d..ca597ee52 100644
    --- a/src/StdMeshers/StdMeshers_NotConformAllowed.cxx
    +++ b/src/StdMeshers/StdMeshers_NotConformAllowed.cxx
    @@ -36,8 +36,8 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_NotConformAllowed::StdMeshers_NotConformAllowed(int hypId, int studyId, SMESH_Gen* gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_NotConformAllowed::StdMeshers_NotConformAllowed(int hypId, SMESH_Gen* gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _name = "NotConformAllowed";
       _param_algo_dim = -1; 
    diff --git a/src/StdMeshers/StdMeshers_NotConformAllowed.hxx b/src/StdMeshers/StdMeshers_NotConformAllowed.hxx
    index 79c4d0210..2f80da9a5 100644
    --- a/src/StdMeshers/StdMeshers_NotConformAllowed.hxx
    +++ b/src/StdMeshers/StdMeshers_NotConformAllowed.hxx
    @@ -37,7 +37,7 @@ class STDMESHERS_EXPORT StdMeshers_NotConformAllowed:
       public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_NotConformAllowed(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_NotConformAllowed(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_NotConformAllowed();
     
       virtual std::ostream & SaveTo(std::ostream & save);
    diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx
    index 55967940c..e560a6ee6 100644
    --- a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx
    +++ b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx
    @@ -42,9 +42,9 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(int hypId, int studyId,
    +StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(int hypId,
                                                          SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _name = "NumberOfLayers"; // used by RadialPrism_3D
       _param_algo_dim = 3; // 3D
    diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers.hxx b/src/StdMeshers/StdMeshers_NumberOfLayers.hxx
    index b8dc0c0d7..b4f7ff2de 100644
    --- a/src/StdMeshers/StdMeshers_NumberOfLayers.hxx
    +++ b/src/StdMeshers/StdMeshers_NumberOfLayers.hxx
    @@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_NumberOfLayers:  public SMESH_Hypothesis
     {
     public:
       // Constructor
    -  StdMeshers_NumberOfLayers( int hypId, int studyId, SMESH_Gen * gen );
    +  StdMeshers_NumberOfLayers( int hypId, SMESH_Gen * gen );
       // Destructor
       virtual ~StdMeshers_NumberOfLayers();
     
    diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers2D.cxx b/src/StdMeshers/StdMeshers_NumberOfLayers2D.cxx
    index 74d6b0c9a..fef954c5a 100644
    --- a/src/StdMeshers/StdMeshers_NumberOfLayers2D.cxx
    +++ b/src/StdMeshers/StdMeshers_NumberOfLayers2D.cxx
    @@ -36,9 +36,8 @@
     //=============================================================================
     
     StdMeshers_NumberOfLayers2D::StdMeshers_NumberOfLayers2D(int hypId,
    -                                                         int studyId,
                                                              SMESH_Gen * gen)
    -  : StdMeshers_NumberOfLayers(hypId, studyId, gen)
    +  : StdMeshers_NumberOfLayers(hypId, gen)
     {
       _name = "NumberOfLayers2D"; // used by RadialQuadrangle_1D2D
       _param_algo_dim = 2; // 2D
    diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers2D.hxx b/src/StdMeshers/StdMeshers_NumberOfLayers2D.hxx
    index 4514debc5..d2df75fe9 100644
    --- a/src/StdMeshers/StdMeshers_NumberOfLayers2D.hxx
    +++ b/src/StdMeshers/StdMeshers_NumberOfLayers2D.hxx
    @@ -43,7 +43,7 @@ class STDMESHERS_EXPORT StdMeshers_NumberOfLayers2D
     {
     public:
       // Constructor
    -  StdMeshers_NumberOfLayers2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_NumberOfLayers2D(int hypId, SMESH_Gen* gen);
       // Destructor
       virtual ~StdMeshers_NumberOfLayers2D();
     };
    diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx
    index 2ff7274fc..b26904eb2 100644
    --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx
    +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx
    @@ -66,9 +66,8 @@ const double PRECISION = 1e-7;
     //=============================================================================
     
     StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments(int         hypId,
    -                                                         int         studyId,
                                                              SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen),
    +  : SMESH_Hypothesis(hypId, gen),
         _numberOfSegments(15),//issue 19923
         _distrType(DT_Regular),
         _scaleFactor(1.),
    diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx
    index 459c286a1..95273c5fa 100644
    --- a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx
    +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx
    @@ -45,7 +45,7 @@ class STDMESHERS_EXPORT StdMeshers_NumberOfSegments:
       public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_NumberOfSegments(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_NumberOfSegments(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_NumberOfSegments();
     
       // Builds point distribution according to passed function
    diff --git a/src/StdMeshers/StdMeshers_PolygonPerFace_2D.cxx b/src/StdMeshers/StdMeshers_PolygonPerFace_2D.cxx
    index 78c4d62e5..37054e80e 100644
    --- a/src/StdMeshers/StdMeshers_PolygonPerFace_2D.cxx
    +++ b/src/StdMeshers/StdMeshers_PolygonPerFace_2D.cxx
    @@ -49,9 +49,8 @@ using namespace std;
     //=======================================================================
     
     StdMeshers_PolygonPerFace_2D::StdMeshers_PolygonPerFace_2D(int        hypId,
    -                                                           int        studyId,
                                                                SMESH_Gen* gen)
    -  :SMESH_2D_Algo(hypId, studyId, gen)
    +  :SMESH_2D_Algo(hypId, gen)
     {
       _name = "PolygonPerFace_2D";
     }
    diff --git a/src/StdMeshers/StdMeshers_PolygonPerFace_2D.hxx b/src/StdMeshers/StdMeshers_PolygonPerFace_2D.hxx
    index 57a7afc8b..a3ff18e18 100644
    --- a/src/StdMeshers/StdMeshers_PolygonPerFace_2D.hxx
    +++ b/src/StdMeshers/StdMeshers_PolygonPerFace_2D.hxx
    @@ -32,7 +32,7 @@
     class STDMESHERS_EXPORT StdMeshers_PolygonPerFace_2D: public SMESH_2D_Algo
     {
      public:
    -  StdMeshers_PolygonPerFace_2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_PolygonPerFace_2D(int hypId, SMESH_Gen* gen);
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
                                    const TopoDS_Shape&                  aShape,
    diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx
    index 9fc322c75..d326cd157 100644
    --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx
    +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx
    @@ -96,15 +96,14 @@ namespace {
        */
       struct TQuadrangleAlgo : public StdMeshers_Quadrangle_2D
       {
    -    TQuadrangleAlgo(int studyId, SMESH_Gen* gen)
    -      : StdMeshers_Quadrangle_2D( gen->GetANewId(), studyId, gen)
    +    TQuadrangleAlgo(SMESH_Gen* gen)
    +      : StdMeshers_Quadrangle_2D( gen->GetANewId(), gen)
         {
         }
         static StdMeshers_Quadrangle_2D* instance( SMESH_Algo*         fatherAlgo,
                                                    SMESH_MesherHelper* helper=0)
         {
    -      static TQuadrangleAlgo* algo = new TQuadrangleAlgo( fatherAlgo->GetStudyId(),
    -                                                          fatherAlgo->GetGen() );
    +      static TQuadrangleAlgo* algo = new TQuadrangleAlgo( fatherAlgo->GetGen() );
           if ( helper &&
                algo->myProxyMesh &&
                algo->myProxyMesh->GetMesh() != helper->GetMesh() )
    @@ -126,16 +125,15 @@ namespace {
       {
         StdMeshers_ProjectionSource1D myHyp;
     
    -    TProjction1dAlgo(int studyId, SMESH_Gen* gen)
    -      : StdMeshers_Projection_1D( gen->GetANewId(), studyId, gen),
    -        myHyp( gen->GetANewId(), studyId, gen)
    +    TProjction1dAlgo(SMESH_Gen* gen)
    +      : StdMeshers_Projection_1D( gen->GetANewId(), gen),
    +        myHyp( gen->GetANewId(), gen)
         {
           StdMeshers_Projection_1D::_sourceHypo = & myHyp;
         }
         static TProjction1dAlgo* instance( SMESH_Algo* fatherAlgo )
         {
    -      static TProjction1dAlgo* algo = new TProjction1dAlgo( fatherAlgo->GetStudyId(),
    -                                                            fatherAlgo->GetGen() );
    +      static TProjction1dAlgo* algo = new TProjction1dAlgo( fatherAlgo->GetGen() );
           return algo;
         }
       };
    @@ -147,16 +145,15 @@ namespace {
       {
         StdMeshers_ProjectionSource2D myHyp;
     
    -    TProjction2dAlgo(int studyId, SMESH_Gen* gen)
    -      : StdMeshers_Projection_1D2D( gen->GetANewId(), studyId, gen),
    -        myHyp( gen->GetANewId(), studyId, gen)
    +    TProjction2dAlgo(SMESH_Gen* gen)
    +      : StdMeshers_Projection_1D2D( gen->GetANewId(), gen),
    +        myHyp( gen->GetANewId(), gen)
         {
           StdMeshers_Projection_2D::_sourceHypo = & myHyp;
         }
         static TProjction2dAlgo* instance( SMESH_Algo* fatherAlgo )
         {
    -      static TProjction2dAlgo* algo = new TProjction2dAlgo( fatherAlgo->GetStudyId(),
    -                                                            fatherAlgo->GetGen() );
    +      static TProjction2dAlgo* algo = new TProjction2dAlgo( fatherAlgo->GetGen() );
           return algo;
         }
         const NSProjUtils::TNodeNodeMap& GetNodesMap()
    @@ -567,8 +564,8 @@ namespace {
     //purpose  : 
     //=======================================================================
     
    -StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_3D_Algo(hypId, studyId, gen)
    +StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen)
    +  :SMESH_3D_Algo(hypId, gen)
     {
       _name                    = "Prism_3D";
       _shapeType               = (1 << TopAbs_SOLID); // 1 bit per shape type
    diff --git a/src/StdMeshers/StdMeshers_Prism_3D.hxx b/src/StdMeshers/StdMeshers_Prism_3D.hxx
    index 62f0b9a14..d9103b72b 100644
    --- a/src/StdMeshers/StdMeshers_Prism_3D.hxx
    +++ b/src/StdMeshers/StdMeshers_Prism_3D.hxx
    @@ -479,7 +479,7 @@ private:
     class STDMESHERS_EXPORT StdMeshers_Prism_3D: public SMESH_3D_Algo
     {
     public:
    -  StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_Prism_3D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
    diff --git a/src/StdMeshers/StdMeshers_ProjectionSource1D.cxx b/src/StdMeshers/StdMeshers_ProjectionSource1D.cxx
    index c3dd4ec00..7dd9a452f 100644
    --- a/src/StdMeshers/StdMeshers_ProjectionSource1D.cxx
    +++ b/src/StdMeshers/StdMeshers_ProjectionSource1D.cxx
    @@ -44,9 +44,9 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(int hypId, int studyId,
    +StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(int hypId,
                                                                  SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _name = "ProjectionSource1D"; // used by Projection_1D
       _param_algo_dim = 1; // 1D
    diff --git a/src/StdMeshers/StdMeshers_ProjectionSource1D.hxx b/src/StdMeshers/StdMeshers_ProjectionSource1D.hxx
    index 122e7fa31..d58535e2d 100644
    --- a/src/StdMeshers/StdMeshers_ProjectionSource1D.hxx
    +++ b/src/StdMeshers/StdMeshers_ProjectionSource1D.hxx
    @@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_ProjectionSource1D: public SMESH_Hypothesis
     {
     public:
       // Constructor
    -  StdMeshers_ProjectionSource1D( int hypId, int studyId, SMESH_Gen * gen );
    +  StdMeshers_ProjectionSource1D( int hypId, SMESH_Gen * gen );
       // Destructor
       virtual ~StdMeshers_ProjectionSource1D();
     
    diff --git a/src/StdMeshers/StdMeshers_ProjectionSource2D.cxx b/src/StdMeshers/StdMeshers_ProjectionSource2D.cxx
    index 0a0f3a81a..ded88d4b7 100644
    --- a/src/StdMeshers/StdMeshers_ProjectionSource2D.cxx
    +++ b/src/StdMeshers/StdMeshers_ProjectionSource2D.cxx
    @@ -45,9 +45,9 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(int hypId, int studyId,
    +StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(int hypId,
                                                                  SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _name = "ProjectionSource2D"; // used by Projection_2D
       _param_algo_dim = 2; // 2D
    diff --git a/src/StdMeshers/StdMeshers_ProjectionSource2D.hxx b/src/StdMeshers/StdMeshers_ProjectionSource2D.hxx
    index b98847ae6..49e49747d 100644
    --- a/src/StdMeshers/StdMeshers_ProjectionSource2D.hxx
    +++ b/src/StdMeshers/StdMeshers_ProjectionSource2D.hxx
    @@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_ProjectionSource2D: public SMESH_Hypothesis
     {
     public:
       // Constructor
    -  StdMeshers_ProjectionSource2D( int hypId, int studyId, SMESH_Gen * gen );
    +  StdMeshers_ProjectionSource2D( int hypId, SMESH_Gen * gen );
       // Destructor
       virtual ~StdMeshers_ProjectionSource2D();
     
    diff --git a/src/StdMeshers/StdMeshers_ProjectionSource3D.cxx b/src/StdMeshers/StdMeshers_ProjectionSource3D.cxx
    index 868553480..bffe39ae3 100644
    --- a/src/StdMeshers/StdMeshers_ProjectionSource3D.cxx
    +++ b/src/StdMeshers/StdMeshers_ProjectionSource3D.cxx
    @@ -43,9 +43,9 @@ using namespace std;
      */
     //=============================================================================
     
    -StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(int hypId, int studyId,
    +StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(int hypId,
                                                                  SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _name = "ProjectionSource3D"; // used by Projection_3D
       _param_algo_dim = 3; // 3D
    diff --git a/src/StdMeshers/StdMeshers_ProjectionSource3D.hxx b/src/StdMeshers/StdMeshers_ProjectionSource3D.hxx
    index 54c5395ce..d4d867e3b 100644
    --- a/src/StdMeshers/StdMeshers_ProjectionSource3D.hxx
    +++ b/src/StdMeshers/StdMeshers_ProjectionSource3D.hxx
    @@ -49,7 +49,7 @@ class STDMESHERS_EXPORT StdMeshers_ProjectionSource3D:  public SMESH_Hypothesis
     {
     public:
       // Constructor
    -  StdMeshers_ProjectionSource3D( int hypId, int studyId, SMESH_Gen * gen );
    +  StdMeshers_ProjectionSource3D( int hypId, SMESH_Gen * gen );
       // Destructor
       virtual ~StdMeshers_ProjectionSource3D();
     
    diff --git a/src/StdMeshers/StdMeshers_Projection_1D.cxx b/src/StdMeshers/StdMeshers_Projection_1D.cxx
    index 976b0311c..029719f1b 100644
    --- a/src/StdMeshers/StdMeshers_Projection_1D.cxx
    +++ b/src/StdMeshers/StdMeshers_Projection_1D.cxx
    @@ -65,8 +65,8 @@ namespace TAssocTool = StdMeshers_ProjectionUtils;
     //purpose  : 
     //=======================================================================
     
    -StdMeshers_Projection_1D::StdMeshers_Projection_1D(int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_1D_Algo(hypId, studyId, gen)
    +StdMeshers_Projection_1D::StdMeshers_Projection_1D(int hypId, SMESH_Gen* gen)
    +  :SMESH_1D_Algo(hypId, gen)
     {
       _name = "Projection_1D";
       _shapeType = (1 << TopAbs_EDGE);      // 1 bit per shape type
    diff --git a/src/StdMeshers/StdMeshers_Projection_1D.hxx b/src/StdMeshers/StdMeshers_Projection_1D.hxx
    index cf7bccb23..a0cef0d64 100644
    --- a/src/StdMeshers/StdMeshers_Projection_1D.hxx
    +++ b/src/StdMeshers/StdMeshers_Projection_1D.hxx
    @@ -38,7 +38,7 @@ class StdMeshers_ProjectionSource1D;
     class STDMESHERS_EXPORT StdMeshers_Projection_1D: public SMESH_1D_Algo
     {
     public:
    -  StdMeshers_Projection_1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Projection_1D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_Projection_1D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
    diff --git a/src/StdMeshers/StdMeshers_Projection_1D2D.cxx b/src/StdMeshers/StdMeshers_Projection_1D2D.cxx
    index c0e53ceeb..607efdfa6 100644
    --- a/src/StdMeshers/StdMeshers_Projection_1D2D.cxx
    +++ b/src/StdMeshers/StdMeshers_Projection_1D2D.cxx
    @@ -93,8 +93,8 @@ namespace
     //purpose  : 
     //=======================================================================
     
    -StdMeshers_Projection_1D2D::StdMeshers_Projection_1D2D(int hypId, int studyId, SMESH_Gen* gen)
    -  :StdMeshers_Projection_2D(hypId, studyId, gen)
    +StdMeshers_Projection_1D2D::StdMeshers_Projection_1D2D(int hypId, SMESH_Gen* gen)
    +  :StdMeshers_Projection_2D(hypId, gen)
     {
       _name = "Projection_1D2D";
       _requireDiscreteBoundary = false;
    diff --git a/src/StdMeshers/StdMeshers_Projection_1D2D.hxx b/src/StdMeshers/StdMeshers_Projection_1D2D.hxx
    index 58e2ce8cc..7f72cc860 100644
    --- a/src/StdMeshers/StdMeshers_Projection_1D2D.hxx
    +++ b/src/StdMeshers/StdMeshers_Projection_1D2D.hxx
    @@ -31,7 +31,7 @@
     class STDMESHERS_EXPORT StdMeshers_Projection_1D2D: public StdMeshers_Projection_2D
     {
     public:
    -  StdMeshers_Projection_1D2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Projection_1D2D(int hypId, SMESH_Gen* gen);
     
       virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
     
    diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx
    index 64ce054c5..038199124 100644
    --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx
    +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx
    @@ -85,8 +85,8 @@ namespace TAssocTool = StdMeshers_ProjectionUtils;
     //purpose  : 
     //=======================================================================
     
    -StdMeshers_Projection_2D::StdMeshers_Projection_2D(int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_2D_Algo(hypId, studyId, gen)
    +StdMeshers_Projection_2D::StdMeshers_Projection_2D(int hypId, SMESH_Gen* gen)
    +  :SMESH_2D_Algo(hypId, gen)
     {
       _name = "Projection_2D";
       _compatibleHypothesis.push_back("ProjectionSource2D");
    diff --git a/src/StdMeshers/StdMeshers_Projection_2D.hxx b/src/StdMeshers/StdMeshers_Projection_2D.hxx
    index 2ccb21729..98864c3fa 100644
    --- a/src/StdMeshers/StdMeshers_Projection_2D.hxx
    +++ b/src/StdMeshers/StdMeshers_Projection_2D.hxx
    @@ -37,7 +37,7 @@ class StdMeshers_ProjectionSource2D;
     class STDMESHERS_EXPORT StdMeshers_Projection_2D: public SMESH_2D_Algo
     {
     public:
    -  StdMeshers_Projection_2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Projection_2D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_Projection_2D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
    diff --git a/src/StdMeshers/StdMeshers_Projection_3D.cxx b/src/StdMeshers/StdMeshers_Projection_3D.cxx
    index 040b2efc4..95bc46913 100644
    --- a/src/StdMeshers/StdMeshers_Projection_3D.cxx
    +++ b/src/StdMeshers/StdMeshers_Projection_3D.cxx
    @@ -65,8 +65,8 @@ using namespace std;
     //purpose  : 
     //=======================================================================
     
    -StdMeshers_Projection_3D::StdMeshers_Projection_3D(int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_3D_Algo(hypId, studyId, gen)
    +StdMeshers_Projection_3D::StdMeshers_Projection_3D(int hypId, SMESH_Gen* gen)
    +  :SMESH_3D_Algo(hypId, gen)
     {
       _name = "Projection_3D";
       _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);  // 1 bit per shape type
    diff --git a/src/StdMeshers/StdMeshers_Projection_3D.hxx b/src/StdMeshers/StdMeshers_Projection_3D.hxx
    index 008ca7429..e09f007ac 100644
    --- a/src/StdMeshers/StdMeshers_Projection_3D.hxx
    +++ b/src/StdMeshers/StdMeshers_Projection_3D.hxx
    @@ -36,7 +36,7 @@ class StdMeshers_ProjectionSource3D;
     class STDMESHERS_EXPORT StdMeshers_Projection_3D: public SMESH_3D_Algo
     {
     public:
    -  StdMeshers_Projection_3D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Projection_3D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_Projection_3D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
    diff --git a/src/StdMeshers/StdMeshers_Propagation.cxx b/src/StdMeshers/StdMeshers_Propagation.cxx
    index 56a5887bc..3d82126ad 100644
    --- a/src/StdMeshers/StdMeshers_Propagation.cxx
    +++ b/src/StdMeshers/StdMeshers_Propagation.cxx
    @@ -85,16 +85,15 @@ namespace {
      */
     //=============================================================================
     
    -StdMeshers_Propagation::StdMeshers_Propagation (int hypId, int studyId, SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_Propagation::StdMeshers_Propagation (int hypId, SMESH_Gen * gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _name = GetName();
       _param_algo_dim = -1; // 1D auxiliary
     }
     StdMeshers_PropagOfDistribution::StdMeshers_PropagOfDistribution (int hypId,
    -                                                                  int studyId,
                                                                       SMESH_Gen * gen)
    -  : StdMeshers_Propagation(hypId, studyId, gen)                        { _name = GetName(); }
    +  : StdMeshers_Propagation(hypId, gen)                                 { _name = GetName(); }
     StdMeshers_Propagation::~StdMeshers_Propagation()                      {}
     string StdMeshers_Propagation::GetName ()                              { return "Propagation"; }
     string StdMeshers_PropagOfDistribution::GetName ()                     { return "PropagOfDistribution"; }
    diff --git a/src/StdMeshers/StdMeshers_Propagation.hxx b/src/StdMeshers/StdMeshers_Propagation.hxx
    index d94608a96..7f76acf0f 100644
    --- a/src/StdMeshers/StdMeshers_Propagation.hxx
    +++ b/src/StdMeshers/StdMeshers_Propagation.hxx
    @@ -46,7 +46,7 @@ class SMESH_HypoFilter;
     class STDMESHERS_EXPORT StdMeshers_Propagation : public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_Propagation(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_Propagation(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_Propagation();
     
       virtual std::ostream & SaveTo(std::ostream & save);
    @@ -105,7 +105,7 @@ class STDMESHERS_EXPORT StdMeshers_Propagation : public SMESH_Hypothesis
     class STDMESHERS_EXPORT StdMeshers_PropagOfDistribution: public StdMeshers_Propagation
     {
      public:
    -  StdMeshers_PropagOfDistribution(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_PropagOfDistribution(int hypId, SMESH_Gen * gen);
     
       static std::string GetName();
     };
    diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx
    index a4d3ffbdd..c531c5aae 100644
    --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx
    +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx
    @@ -71,8 +71,8 @@ using namespace std;
     class StdMeshers_QuadFromMedialAxis_1D2D::Algo1D : public StdMeshers_Regular_1D
     {
     public:
    -  Algo1D(int studyId, SMESH_Gen* gen):
    -    StdMeshers_Regular_1D( gen->GetANewId(), studyId, gen )
    +  Algo1D(SMESH_Gen* gen):
    +    StdMeshers_Regular_1D( gen->GetANewId(), gen )
       {
       }
       void SetSegmentLength( double len )
    @@ -152,9 +152,8 @@ public:
     //================================================================================
     
     StdMeshers_QuadFromMedialAxis_1D2D::StdMeshers_QuadFromMedialAxis_1D2D(int        hypId,
    -                                                                       int        studyId,
                                                                            SMESH_Gen* gen)
    -  : StdMeshers_Quadrangle_2D(hypId, studyId, gen),
    +  : StdMeshers_Quadrangle_2D(hypId, gen),
         _regular1D( 0 )
     {
       _name = "QuadFromMedialAxis_1D2D";
    @@ -741,7 +740,7 @@ namespace
         }
     
         // cout << "from salome.geom import geomBuilder" << endl;
    -    // cout << "geompy = geomBuilder.New(salome.myStudy)" << endl;
    +    // cout << "geompy = geomBuilder.New()" << endl;
         Handle(TColgp_HArray1OfPnt) points = new TColgp_HArray1OfPnt(1, pnt.size());
         for ( size_t i = 0; i < pnt.size(); ++i )
         {
    @@ -2166,7 +2165,7 @@ bool StdMeshers_QuadFromMedialAxis_1D2D::Compute(SMESH_Mesh&         theMesh,
         SMESH_MAT2d::MedialAxis ma( F, sinuFace._sinuEdges, minSegLen, /*ignoreCorners=*/true );
     
         if ( !_regular1D )
    -      _regular1D = new Algo1D( _studyId, _gen );
    +      _regular1D = new Algo1D( _gen );
         _regular1D->SetSegmentLength( minSegLen );
     
         vector maParams;
    diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.hxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.hxx
    index 43a62deba..0940f15f0 100644
    --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.hxx
    +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.hxx
    @@ -37,7 +37,7 @@
     class STDMESHERS_EXPORT StdMeshers_QuadFromMedialAxis_1D2D: public StdMeshers_Quadrangle_2D
     {
      public:
    -  StdMeshers_QuadFromMedialAxis_1D2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_QuadFromMedialAxis_1D2D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_QuadFromMedialAxis_1D2D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
    diff --git a/src/StdMeshers/StdMeshers_QuadrangleParams.cxx b/src/StdMeshers/StdMeshers_QuadrangleParams.cxx
    index e45b4cf68..dc3e692e1 100644
    --- a/src/StdMeshers/StdMeshers_QuadrangleParams.cxx
    +++ b/src/StdMeshers/StdMeshers_QuadrangleParams.cxx
    @@ -42,9 +42,9 @@ using namespace std;
      *
      */
     //=============================================================================
    -StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId, int studyId,
    +StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId,
                                                              SMESH_Gen * gen)
    -  : SMESH_Hypothesis(hypId, studyId, gen)
    +  : SMESH_Hypothesis(hypId, gen)
     {
       _name = "QuadrangleParams";
       _param_algo_dim = 2;
    diff --git a/src/StdMeshers/StdMeshers_QuadrangleParams.hxx b/src/StdMeshers/StdMeshers_QuadrangleParams.hxx
    index 051ec58a2..64247e0b6 100644
    --- a/src/StdMeshers/StdMeshers_QuadrangleParams.hxx
    +++ b/src/StdMeshers/StdMeshers_QuadrangleParams.hxx
    @@ -44,7 +44,7 @@ enum StdMeshers_QuadType
     class STDMESHERS_EXPORT StdMeshers_QuadrangleParams: public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_QuadrangleParams(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_QuadrangleParams(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_QuadrangleParams();
     
       void SetTriaVertex (int id);
    diff --git a/src/StdMeshers/StdMeshers_QuadranglePreference.cxx b/src/StdMeshers/StdMeshers_QuadranglePreference.cxx
    index b6c49182a..453b1fd6c 100644
    --- a/src/StdMeshers/StdMeshers_QuadranglePreference.cxx
    +++ b/src/StdMeshers/StdMeshers_QuadranglePreference.cxx
    @@ -36,9 +36,8 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_QuadranglePreference::StdMeshers_QuadranglePreference(int         hypId,
    -                                                                 int         studyId,
                                                                      SMESH_Gen * gen)
    -     :SMESH_Hypothesis(hypId, studyId, gen)
    +     :SMESH_Hypothesis(hypId, gen)
     {
       _name = "QuadranglePreference";
       _param_algo_dim = -2; // auxiliary used by NETGEN 2D
    diff --git a/src/StdMeshers/StdMeshers_QuadranglePreference.hxx b/src/StdMeshers/StdMeshers_QuadranglePreference.hxx
    index 6ed0677c1..747ed7e5f 100644
    --- a/src/StdMeshers/StdMeshers_QuadranglePreference.hxx
    +++ b/src/StdMeshers/StdMeshers_QuadranglePreference.hxx
    @@ -41,7 +41,7 @@
     class STDMESHERS_EXPORT StdMeshers_QuadranglePreference:public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_QuadranglePreference(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_QuadranglePreference(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_QuadranglePreference();
       
       virtual std::ostream & SaveTo(std::ostream & save);
    diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
    index ef472e49a..9a51d8a6d 100644
    --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
    +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
    @@ -82,9 +82,9 @@ typedef SMESH_Comment TComm;
      */
     //=============================================================================
     
    -StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId, int studyId,
    +StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId,
                                                         SMESH_Gen* gen)
    -  : SMESH_2D_Algo(hypId, studyId, gen),
    +  : SMESH_2D_Algo(hypId, gen),
         myQuadranglePreference(false),
         myTrianglePreference(false),
         myTriaVertexID(-1),
    diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
    index b35a1425f..7c121fb1f 100644
    --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
    +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx
    @@ -135,7 +135,7 @@ struct FaceQuadStruct
     class STDMESHERS_EXPORT StdMeshers_Quadrangle_2D: public SMESH_2D_Algo
     {
      public:
    -  StdMeshers_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Quadrangle_2D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_Quadrangle_2D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
    diff --git a/src/StdMeshers/StdMeshers_QuadraticMesh.cxx b/src/StdMeshers/StdMeshers_QuadraticMesh.cxx
    index e014c36c9..0203e322b 100644
    --- a/src/StdMeshers/StdMeshers_QuadraticMesh.cxx
    +++ b/src/StdMeshers/StdMeshers_QuadraticMesh.cxx
    @@ -36,9 +36,8 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_QuadraticMesh::StdMeshers_QuadraticMesh(int         hypId,
    -                                                   int         studyId,
                                                        SMESH_Gen * gen)
    -     :SMESH_Hypothesis(hypId, studyId, gen)
    +     :SMESH_Hypothesis(hypId, gen)
     {
       _name = "QuadraticMesh";
       _param_algo_dim = -1; // it means auxiliary, dim = 1
    diff --git a/src/StdMeshers/StdMeshers_QuadraticMesh.hxx b/src/StdMeshers/StdMeshers_QuadraticMesh.hxx
    index aba088089..5073faa5e 100644
    --- a/src/StdMeshers/StdMeshers_QuadraticMesh.hxx
    +++ b/src/StdMeshers/StdMeshers_QuadraticMesh.hxx
    @@ -43,7 +43,7 @@
     class STDMESHERS_EXPORT StdMeshers_QuadraticMesh:public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_QuadraticMesh(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_QuadraticMesh(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_QuadraticMesh();
       
       virtual std::ostream & SaveTo(std::ostream & save);
    diff --git a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx
    index bbf339a8b..dd533d9b7 100644
    --- a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx
    +++ b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx
    @@ -71,8 +71,8 @@ namespace ProjectionUtils = StdMeshers_ProjectionUtils;
     //purpose  : 
     //=======================================================================
     
    -StdMeshers_RadialPrism_3D::StdMeshers_RadialPrism_3D(int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_3D_Algo(hypId, studyId, gen)
    +StdMeshers_RadialPrism_3D::StdMeshers_RadialPrism_3D(int hypId, SMESH_Gen* gen)
    +  :SMESH_3D_Algo(hypId, gen)
     {
       _name = "RadialPrism_3D";
       _shapeType = (1 << TopAbs_SOLID);     // 1 bit per shape type
    @@ -338,7 +338,7 @@ public:
         const int myID = -1000;
         TNodeDistributor* myHyp = dynamic_cast( aMesh.GetHypothesis( myID ));
         if ( !myHyp )
    -      myHyp = new TNodeDistributor( myID, 0, aMesh.GetGen() );
    +      myHyp = new TNodeDistributor( myID, aMesh.GetGen() );
         return myHyp;
       }
       // -----------------------------------------------------------------------------
    @@ -376,8 +376,8 @@ public:
       }
     protected:
       // -----------------------------------------------------------------------------
    -  TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen)
    -    : StdMeshers_Regular_1D( hypId, studyId, gen)
    +  TNodeDistributor( int hypId, SMESH_Gen* gen)
    +    : StdMeshers_Regular_1D( hypId, gen)
       {
       }
       // -----------------------------------------------------------------------------
    diff --git a/src/StdMeshers/StdMeshers_RadialPrism_3D.hxx b/src/StdMeshers/StdMeshers_RadialPrism_3D.hxx
    index 144905e81..34561414f 100644
    --- a/src/StdMeshers/StdMeshers_RadialPrism_3D.hxx
    +++ b/src/StdMeshers/StdMeshers_RadialPrism_3D.hxx
    @@ -43,7 +43,7 @@ class gp_Pnt;
     class STDMESHERS_EXPORT StdMeshers_RadialPrism_3D: public SMESH_3D_Algo
     {
     public:
    -  StdMeshers_RadialPrism_3D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_RadialPrism_3D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_RadialPrism_3D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
    diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
    index dc573828e..9828818f9 100644
    --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
    +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
    @@ -74,9 +74,8 @@ using namespace std;
     //=======================================================================
     
     StdMeshers_RadialQuadrangle_1D2D::StdMeshers_RadialQuadrangle_1D2D(int        hypId,
    -                                                                   int        studyId,
                                                                        SMESH_Gen* gen)
    -  :StdMeshers_Quadrangle_2D( hypId, studyId, gen )
    +  :StdMeshers_Quadrangle_2D( hypId, gen )
     {
       _name = "RadialQuadrangle_1D2D";
       _shapeType = (1 << TopAbs_FACE);        // 1 bit per shape type
    @@ -631,7 +630,7 @@ public:
         const int myID = -1001;
         TNodeDistributor* myHyp = dynamic_cast( aMesh.GetHypothesis( myID ));
         if ( !myHyp )
    -      myHyp = new TNodeDistributor( myID, 0, aMesh.GetGen() );
    +      myHyp = new TNodeDistributor( myID, aMesh.GetGen() );
         return myHyp;
       }
       // -----------------------------------------------------------------------------
    @@ -726,8 +725,8 @@ public:
       }
     protected:
       // -----------------------------------------------------------------------------
    -  TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen)
    -    : StdMeshers_Regular_1D( hypId, studyId, gen)
    +  TNodeDistributor( int hypId, SMESH_Gen* gen)
    +    : StdMeshers_Regular_1D( hypId, gen)
       {
       }
       // -----------------------------------------------------------------------------
    diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx
    index a029757dd..a53b02859 100644
    --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx
    +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx
    @@ -39,7 +39,7 @@ class StdMeshers_LayerDistribution;
     class STDMESHERS_EXPORT StdMeshers_RadialQuadrangle_1D2D: public StdMeshers_Quadrangle_2D
     {
     public:
    -  StdMeshers_RadialQuadrangle_1D2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_RadialQuadrangle_1D2D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_RadialQuadrangle_1D2D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
    diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx
    index 6746a502c..d1aa0122d 100644
    --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx
    +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx
    @@ -78,9 +78,8 @@ using namespace StdMeshers;
     //=============================================================================
     
     StdMeshers_Regular_1D::StdMeshers_Regular_1D(int         hypId,
    -                                             int         studyId,
                                                  SMESH_Gen * gen)
    -  :SMESH_1D_Algo( hypId, studyId, gen )
    +  :SMESH_1D_Algo( hypId, gen )
     {
       _name = "Regular_1D";
       _shapeType = (1 << TopAbs_EDGE);
    @@ -629,7 +628,7 @@ void StdMeshers_Regular_1D::redistributeNearVertices (SMESH_Mesh &          theM
             double L = GCPnts_AbscissaPoint::Length( theC3d, *itU, l);
             static StdMeshers_Regular_1D* auxAlgo = 0;
             if ( !auxAlgo ) {
    -          auxAlgo = new StdMeshers_Regular_1D( _gen->GetANewId(), _studyId, _gen );
    +          auxAlgo = new StdMeshers_Regular_1D( _gen->GetANewId(), _gen );
               auxAlgo->_hypType = BEG_END_LENGTH;
             }
             auxAlgo->_value[ BEG_LENGTH_IND ] = Lm;
    diff --git a/src/StdMeshers/StdMeshers_Regular_1D.hxx b/src/StdMeshers/StdMeshers_Regular_1D.hxx
    index d2af675f7..bc17cf4f8 100644
    --- a/src/StdMeshers/StdMeshers_Regular_1D.hxx
    +++ b/src/StdMeshers/StdMeshers_Regular_1D.hxx
    @@ -44,7 +44,7 @@ class TopoDS_Vertex;
     class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo
     {
     public:
    -  StdMeshers_Regular_1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Regular_1D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_Regular_1D();
     
       virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
    diff --git a/src/StdMeshers/StdMeshers_Reversible1D.cxx b/src/StdMeshers/StdMeshers_Reversible1D.cxx
    index b5b20f7af..72c435d90 100644
    --- a/src/StdMeshers/StdMeshers_Reversible1D.cxx
    +++ b/src/StdMeshers/StdMeshers_Reversible1D.cxx
    @@ -33,8 +33,8 @@
      */
     //=============================================================================
     
    -StdMeshers_Reversible1D::StdMeshers_Reversible1D(int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen)
    +StdMeshers_Reversible1D::StdMeshers_Reversible1D(int hypId, SMESH_Gen * gen)
    +  :SMESH_Hypothesis(hypId, gen)
     {
       _param_algo_dim = 1; 
     }
    diff --git a/src/StdMeshers/StdMeshers_Reversible1D.hxx b/src/StdMeshers/StdMeshers_Reversible1D.hxx
    index c146e1728..a8d62257c 100644
    --- a/src/StdMeshers/StdMeshers_Reversible1D.hxx
    +++ b/src/StdMeshers/StdMeshers_Reversible1D.hxx
    @@ -38,7 +38,7 @@
     class STDMESHERS_EXPORT StdMeshers_Reversible1D : public SMESH_Hypothesis
     {
     public:
    -  StdMeshers_Reversible1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_Reversible1D(int hypId, SMESH_Gen* gen);
     
       void SetReversedEdges( const std::vector& ids);
     
    diff --git a/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx b/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx
    index f938d2829..c5bb4fd0d 100644
    --- a/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx
    +++ b/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.cxx
    @@ -36,8 +36,8 @@
     //=======================================================================
     
     StdMeshers_SegmentAroundVertex_0D::StdMeshers_SegmentAroundVertex_0D
    -                                   (int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_0D_Algo(hypId, studyId, gen)
    +                                   (int hypId, SMESH_Gen* gen)
    +  :SMESH_0D_Algo(hypId, gen)
     {
       _name = "SegmentAroundVertex_0D";
       // it is assigned to vertices but influence a state of EDGE submeshes
    diff --git a/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.hxx b/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.hxx
    index 3e863df4c..c8fbe88c1 100644
    --- a/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.hxx
    +++ b/src/StdMeshers/StdMeshers_SegmentAroundVertex_0D.hxx
    @@ -38,7 +38,7 @@
     class STDMESHERS_EXPORT StdMeshers_SegmentAroundVertex_0D: public SMESH_0D_Algo
     {
     public:
    -  StdMeshers_SegmentAroundVertex_0D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_SegmentAroundVertex_0D(int hypId, SMESH_Gen* gen);
       virtual ~StdMeshers_SegmentAroundVertex_0D();
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
    diff --git a/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx b/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx
    index 317d44cbd..1b0dd37ce 100644
    --- a/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx
    +++ b/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx
    @@ -50,8 +50,8 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_SegmentLengthAroundVertex::StdMeshers_SegmentLengthAroundVertex
    -                                       (int hypId, int studyId, SMESH_Gen * gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen)
    +                                       (int hypId, SMESH_Gen * gen)
    +  :SMESH_Hypothesis(hypId, gen)
     {
       _length = 1.;
       _name = "SegmentLengthAroundVertex";
    diff --git a/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.hxx b/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.hxx
    index 66b095c13..198ba34c6 100644
    --- a/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.hxx
    +++ b/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.hxx
    @@ -40,7 +40,7 @@
     class STDMESHERS_EXPORT StdMeshers_SegmentLengthAroundVertex:public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_SegmentLengthAroundVertex(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_SegmentLengthAroundVertex(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_SegmentLengthAroundVertex();
     
       void SetLength(double length) throw(SALOME_Exception);
    diff --git a/src/StdMeshers/StdMeshers_StartEndLength.cxx b/src/StdMeshers/StdMeshers_StartEndLength.cxx
    index 5e63f8cae..a78244733 100644
    --- a/src/StdMeshers/StdMeshers_StartEndLength.cxx
    +++ b/src/StdMeshers/StdMeshers_StartEndLength.cxx
    @@ -48,9 +48,8 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_StartEndLength::StdMeshers_StartEndLength(int         hypId,
    -                                                     int         studyId,
                                                          SMESH_Gen * gen)
    -     :SMESH_Hypothesis(hypId, studyId, gen)
    +     :SMESH_Hypothesis(hypId, gen)
     {
       _begLength = 1.;
       _endLength = 10.;
    diff --git a/src/StdMeshers/StdMeshers_StartEndLength.hxx b/src/StdMeshers/StdMeshers_StartEndLength.hxx
    index 37a442c43..fed02351a 100644
    --- a/src/StdMeshers/StdMeshers_StartEndLength.hxx
    +++ b/src/StdMeshers/StdMeshers_StartEndLength.hxx
    @@ -37,7 +37,7 @@
     class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis
     {
      public:
    -  StdMeshers_StartEndLength(int hypId, int studyId, SMESH_Gen * gen);
    +  StdMeshers_StartEndLength(int hypId, SMESH_Gen * gen);
       virtual ~ StdMeshers_StartEndLength();
     
       void SetLength(double length, bool isStartLength) throw(SALOME_Exception);
    diff --git a/src/StdMeshers/StdMeshers_UseExisting_1D2D.cxx b/src/StdMeshers/StdMeshers_UseExisting_1D2D.cxx
    index 6fcd338dc..1f8a5b03b 100644
    --- a/src/StdMeshers/StdMeshers_UseExisting_1D2D.cxx
    +++ b/src/StdMeshers/StdMeshers_UseExisting_1D2D.cxx
    @@ -34,8 +34,8 @@
     //=======================================================================
     
     StdMeshers_UseExisting_1D::StdMeshers_UseExisting_1D
    -                                   (int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_1D_Algo(hypId, studyId, gen)
    +                                   (int hypId, SMESH_Gen* gen)
    +  :SMESH_1D_Algo(hypId, gen)
     {
       _name = "UseExisting_1D";
       _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
    @@ -89,8 +89,8 @@ bool StdMeshers_UseExisting_1D::Evaluate(SMESH_Mesh&,
     //=======================================================================
     
     StdMeshers_UseExisting_2D::StdMeshers_UseExisting_2D
    -                                   (int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_2D_Algo(hypId, studyId, gen)
    +                                   (int hypId, SMESH_Gen* gen)
    +  :SMESH_2D_Algo(hypId, gen)
     {
       _name = "UseExisting_2D";
       _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
    diff --git a/src/StdMeshers/StdMeshers_UseExisting_1D2D.hxx b/src/StdMeshers/StdMeshers_UseExisting_1D2D.hxx
    index 9bcb4a0ff..307693819 100644
    --- a/src/StdMeshers/StdMeshers_UseExisting_1D2D.hxx
    +++ b/src/StdMeshers/StdMeshers_UseExisting_1D2D.hxx
    @@ -35,7 +35,7 @@
     class STDMESHERS_EXPORT StdMeshers_UseExisting_2D: public SMESH_2D_Algo
     {
     public:
    -  StdMeshers_UseExisting_2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_UseExisting_2D(int hypId, SMESH_Gen* gen);
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
                                    const TopoDS_Shape&                  aShape,
    @@ -50,7 +50,7 @@ public:
     class STDMESHERS_EXPORT StdMeshers_UseExisting_1D: public SMESH_1D_Algo
     {
     public:
    -  StdMeshers_UseExisting_1D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_UseExisting_1D(int hypId, SMESH_Gen* gen);
     
       virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
                                    const TopoDS_Shape&                  aShape,
    diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx
    index 8212b0a8b..eafdf22ef 100644
    --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx
    +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx
    @@ -1205,8 +1205,8 @@ namespace VISCOUS_3D
     //================================================================================
     // StdMeshers_ViscousLayers hypothesis
     //
    -StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(int hypId, int studyId, SMESH_Gen* gen)
    -  :SMESH_Hypothesis(hypId, studyId, gen),
    +StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(int hypId, SMESH_Gen* gen)
    +  :SMESH_Hypothesis(hypId, gen),
        _isToIgnoreShapes(1), _nbLayers(1), _thickness(1), _stretchFactor(1),
        _method( SURF_OFFSET_SMOOTH )
     {
    @@ -1681,8 +1681,8 @@ namespace VISCOUS_3D
           py = _pyStream = new ofstream(fname);
           *py << "import SMESH" << endl
               << "from salome.smesh import smeshBuilder" << endl
    -          << "smesh  = smeshBuilder.New(salome.myStudy)" << endl
    -          << "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:" << tag <<"')" << endl
    +          << "smesh  = smeshBuilder.New()" << endl
    +          << "meshSO = salome.myStudy.FindObjectID('0:1:2:" << tag <<"')" << endl
               << "mesh   = smesh.Mesh( meshSO.GetObject() )"<GetStudyContext( _studyId );
    +  StudyContextStruct* sc = _gen->GetStudyContext();
       std::map < int, SMESH_Mesh * >::iterator i_smesh = sc->mapMesh.begin();
       for ( ; i_smesh != sc->mapMesh.end(); ++i_smesh )
       {
    diff --git a/src/StdMeshers/StdMeshers_ViscousLayers2D.hxx b/src/StdMeshers/StdMeshers_ViscousLayers2D.hxx
    index cff610b17..554cee395 100644
    --- a/src/StdMeshers/StdMeshers_ViscousLayers2D.hxx
    +++ b/src/StdMeshers/StdMeshers_ViscousLayers2D.hxx
    @@ -35,7 +35,7 @@ class StdMeshers_FaceSide;
     class STDMESHERS_EXPORT StdMeshers_ViscousLayers2D : public StdMeshers_ViscousLayers
     {
     public:
    -  StdMeshers_ViscousLayers2D(int hypId, int studyId, SMESH_Gen* gen);
    +  StdMeshers_ViscousLayers2D(int hypId, SMESH_Gen* gen);
       /*!
        * \brief Computes temporary 2D mesh to be used by 2D algorithm.
        *        Return SMESH_ProxyMesh for the given FACE, or NULL in case of error
    diff --git a/src/StdMeshersGUI/CMakeLists.txt b/src/StdMeshersGUI/CMakeLists.txt
    index 1b390d361..74f469940 100644
    --- a/src/StdMeshersGUI/CMakeLists.txt
    +++ b/src/StdMeshersGUI/CMakeLists.txt
    @@ -63,6 +63,7 @@ SET(_link_LIBRARIES
       ${QWT_LIBRARY}
       SalomeIDLSMESH
       SMESHFiltersSelection
    +  SMESHEngine
       SMESH
       SMESHObject
     )
    diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx
    index 6f243e037..9f1de0c28 100644
    --- a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx
    +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx
    @@ -152,7 +152,7 @@ void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( QAction* a )
       SMESH::SMESH_Gen_var gen = mySMESHGUI->GetSMESHGen();
     
       // avoid publishing a new 1D hyp
    -  gen->SetCurrentStudy( SALOMEDS::Study::_nil() );
    +  gen->SetEnablePublish( false );
     
       // create a hyp
       HypothesisData* aHypData = 0;
    @@ -174,7 +174,7 @@ void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( QAction* a )
       }
     
       // restore current study
    -  mySMESHGUI->GetSMESHGen();
    +  gen->SetEnablePublish( true );
     
       onEdit();
     }
    diff --git a/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx
    index 823331951..5b6b54512 100644
    --- a/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx
    +++ b/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx
    @@ -227,9 +227,9 @@ void StdMeshersGUI_ObjectReferenceParamWdg::SetObjects(SMESH::string_array_var&
       
       for ( unsigned i = 0; i < objects->length(); ++i )
       {
    -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    +    _PTR(Study) aStudy = SMESH::getStudy();
         _PTR(SObject) aSObj = aStudy->FindObjectID(objects[i].in());
    -    CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
    +    CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
         if ( !CORBA::is_nil( anObj )) {
           std::string name = aSObj->GetName();
           QString text = myObjNameLineEdit->text();
    diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
    index a7841c1e5..8c49daa2a 100644
    --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
    +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
    @@ -423,10 +423,10 @@ bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
           GEOM::GEOM_Object_var face = w->GetObject< GEOM::GEOM_Object >();
     
           GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
    -      _PTR(Study)         aStudy = SMESH::GetActiveStudyDocument();
    +      _PTR(Study)         aStudy = SMESH::getStudy();
           GEOM::GEOM_IShapesOperations_wrap shapeOp;
           if ( !geomGen->_is_nil() && aStudy )
    -        shapeOp = geomGen->GetIShapesOperations( aStudy->StudyId() );
    +        shapeOp = geomGen->GetIShapesOperations();
           if ( !shapeOp->_is_nil() )
           {
             GEOM::ListOfLong_var vertices =
    diff --git a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx
    index 0518ee07c..a3a54de51 100644
    --- a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx
    +++ b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx
    @@ -578,16 +578,12 @@ void StdMeshersGUI_SubShapeSelectorWdg::updateState()
     GEOM::GEOM_Object_var StdMeshersGUI_SubShapeSelectorWdg::GetGeomObjectByEntry( const QString& theEntry )
     {
       GEOM::GEOM_Object_var aGeomObj;
    -  SALOMEDS::Study_var aStudy = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
    -  if ( !aStudy->_is_nil() )
    +  SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.toLatin1().data() );
    +  if (!aSObj->_is_nil() )
       {
    -    SALOMEDS::SObject_var aSObj = aStudy->FindObjectID( theEntry.toLatin1().data() );
    -    if (!aSObj->_is_nil() )
    -    {
    -      CORBA::Object_var obj = aSObj->GetObject();
    -      aGeomObj = GEOM::GEOM_Object::_narrow(obj);
    -      aSObj->UnRegister();
    -    }
    +    CORBA::Object_var obj = aSObj->GetObject();
    +    aGeomObj = GEOM::GEOM_Object::_narrow(obj);
    +    aSObj->UnRegister();
       }
       return aGeomObj._retn();
     }
    diff --git a/src/StdMeshers_I/StdMeshers_Adaptive1D_i.cxx b/src/StdMeshers_I/StdMeshers_Adaptive1D_i.cxx
    index d0439c955..de799712d 100644
    --- a/src/StdMeshers_I/StdMeshers_Adaptive1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Adaptive1D_i.cxx
    @@ -39,13 +39,11 @@
     //=======================================================================
     
     StdMeshers_Adaptive1D_i::StdMeshers_Adaptive1D_i( PortableServer::POA_ptr thePOA,
    -                                                  int                     theStudyId,
                                                       ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Adaptive1D( theGenImpl->GetANewId(),
    -                                            theStudyId,
                                                 theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx b/src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx
    index 7aa2c1879..060b8b42a 100644
    --- a/src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Adaptive1D_i.hxx
    @@ -46,7 +46,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Adaptive1D_i:
      public:
       // Constructor
       StdMeshers_Adaptive1D_i( PortableServer::POA_ptr thePOA,
    -                           int                     theStudyId,
                                ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_Adaptive1D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx
    index 824530ec2..f5a608144 100644
    --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx
    @@ -46,14 +46,12 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
    -                                                    int                     theStudyId,
    -                                                    ::SMESH_Gen*            theGenImpl )
    +                                                      ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Arithmetic1D( theGenImpl->GetANewId(),
    -                                             theStudyId,
    -                                             theGenImpl );
    +                                              theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx
    index 6dece73a4..622354e99 100644
    --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx
    @@ -46,7 +46,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Arithmetic1D_i:
     public:
       // Constructor
       StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
    -                            int                     theStudyId,
                                  ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_Arithmetic1D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx
    index d532e3935..9121614d6 100644
    --- a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx
    @@ -47,13 +47,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_AutomaticLength_i::StdMeshers_AutomaticLength_i( PortableServer::POA_ptr thePOA,
    -                                                            int                     theStudyId,
                                                                 ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_AutomaticLength( theGenImpl->GetANewId(),
    -                                                 theStudyId,
                                                      theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx
    index d883d1b0b..63847bd6d 100644
    --- a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx
    @@ -50,7 +50,6 @@ class STDMESHERS_I_EXPORT StdMeshers_AutomaticLength_i:
     public:
       // Constructor
       StdMeshers_AutomaticLength_i( PortableServer::POA_ptr thePOA,
    -                                int                     theStudyId,
                                     ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_AutomaticLength_i();
    diff --git a/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx b/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx
    index 90d4ea492..18c7426e8 100644
    --- a/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx
    @@ -59,13 +59,11 @@ namespace
     
     StdMeshers_CartesianParameters3D_i::
     StdMeshers_CartesianParameters3D_i( PortableServer::POA_ptr thePOA,
    -                                    int                     theStudyId,
                                         ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_CartesianParameters3D( theGenImpl->GetANewId(),
    -                                                       theStudyId,
                                                            theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx b/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx
    index fb1fc91b3..d9f4d603a 100644
    --- a/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.hxx
    @@ -46,7 +46,6 @@ class STDMESHERS_I_EXPORT StdMeshers_CartesianParameters3D_i:
      public:
       // Constructor
       StdMeshers_CartesianParameters3D_i( PortableServer::POA_ptr thePOA,
    -                                      int                     theStudyId,
                                           ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_CartesianParameters3D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_Cartesian_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Cartesian_3D_i.cxx
    index 2eeaff8d1..b45cb6c0e 100644
    --- a/src/StdMeshers_I/StdMeshers_Cartesian_3D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Cartesian_3D_i.cxx
    @@ -38,7 +38,6 @@
     //=============================================================================
     
     StdMeshers_Cartesian_3D_i::StdMeshers_Cartesian_3D_i( PortableServer::POA_ptr thePOA,
    -                                                      int                     theStudyId,
                                                           ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA ), 
    @@ -46,7 +45,6 @@ StdMeshers_Cartesian_3D_i::StdMeshers_Cartesian_3D_i( PortableServer::POA_ptr th
         SMESH_3D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Cartesian_3D( theGenImpl->GetANewId(),
    -                                              theStudyId,
                                                   theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Cartesian_3D_i.hxx b/src/StdMeshers_I/StdMeshers_Cartesian_3D_i.hxx
    index 1eca0a00e..6376d36d5 100644
    --- a/src/StdMeshers_I/StdMeshers_Cartesian_3D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Cartesian_3D_i.hxx
    @@ -45,7 +45,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Cartesian_3D_i:
     public:
       // Constructor
       StdMeshers_Cartesian_3D_i( PortableServer::POA_ptr thePOA,
    -                             int                     theStudyId,
                                  ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    diff --git a/src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.cxx b/src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.cxx
    index 01a579b56..482a9f16a 100644
    --- a/src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.cxx
    @@ -43,7 +43,6 @@ using namespace std;
     
     StdMeshers_CompositeSegment_1D_i::StdMeshers_CompositeSegment_1D_i
                                                     ( PortableServer::POA_ptr thePOA,
    -                                                  int                     theStudyId,
                                                       ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -51,7 +50,6 @@ StdMeshers_CompositeSegment_1D_i::StdMeshers_CompositeSegment_1D_i
            SMESH_1D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_CompositeSegment_1D( theGenImpl->GetANewId(),
    -                                                     theStudyId,
                                                          theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.hxx b/src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.hxx
    index b7811f629..b8f994863 100644
    --- a/src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_CompositeSegment_1D_i.hxx
    @@ -44,7 +44,6 @@ class StdMeshers_CompositeSegment_1D_i:
     public:
       // Constructor
       StdMeshers_CompositeSegment_1D_i( PortableServer::POA_ptr thePOA,
    -                                    int                     theStudyId,
                                         ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_CompositeSegment_1D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx
    index add0ede6d..a89708793 100644
    --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx
    @@ -47,14 +47,12 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i( PortableServer::POA_ptr thePOA,
    -                                          int                     theStudyId,
    -                                          ::SMESH_Gen*            theGenImpl )
    +                                                      ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Deflection1D( theGenImpl->GetANewId(),
    -                                        theStudyId,
    -                                        theGenImpl );
    +                                              theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx
    index 722da9b42..dfac16e1d 100644
    --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx
    @@ -49,8 +49,7 @@ class STDMESHERS_I_EXPORT StdMeshers_Deflection1D_i:
     public:
       // Constructor
       StdMeshers_Deflection1D_i( PortableServer::POA_ptr thePOA,
    -                       int                     theStudyId,
    -                       ::SMESH_Gen*            theGenImpl );
    +                             ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_Deflection1D_i();
     
    diff --git a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx
    index fbaa715c6..e6323cd31 100644
    --- a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx
    @@ -44,13 +44,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA,
    -                                                        int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_FixedPoints1D(theGenImpl->GetANewId(),
    -                                              theStudyId,
                                                   theGenImpl);
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx
    index 375223821..7261ff7a7 100644
    --- a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx
    @@ -43,7 +43,6 @@ class STDMESHERS_I_EXPORT StdMeshers_FixedPoints1D_i:
     public:
       // Constructor
       StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_FixedPoints1D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx b/src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx
    index cd4d6ec0d..1530dc26c 100644
    --- a/src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Geometric1D_i.cxx
    @@ -41,14 +41,12 @@
     //=============================================================================
     
     StdMeshers_Geometric1D_i::StdMeshers_Geometric1D_i( PortableServer::POA_ptr thePOA,
    -                                                    int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA ),
         StdMeshers_Reversible1D_i( this )
     {
       myBaseImpl = new ::StdMeshers_Geometric1D( theGenImpl->GetANewId(),
    -                                             theStudyId,
                                                  theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx b/src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx
    index 38f0b6d8d..f3a8964be 100644
    --- a/src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Geometric1D_i.hxx
    @@ -47,7 +47,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Geometric1D_i:
      public:
       // Constructor
       StdMeshers_Geometric1D_i( PortableServer::POA_ptr thePOA,
    -                            int                     theStudyId,
                                 ::SMESH_Gen*            theGenImpl );
     
       void SetStartLength(CORBA::Double length) throw(SALOME::SALOME_Exception);
    diff --git a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx
    index 88e418edf..6a47515cb 100644
    --- a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx
    @@ -43,7 +43,6 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
    -                                            int                     theStudyId,
                                                 ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA ),
    @@ -51,7 +50,6 @@ StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
         SMESH_3D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Hexa_3D( theGenImpl->GetANewId(),
    -                                         theStudyId,
                                              theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx
    index 98ef012dc..37d38c035 100644
    --- a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx
    @@ -49,8 +49,7 @@ class STDMESHERS_I_EXPORT StdMeshers_Hexa_3D_i:
     public:
       // Constructor
       StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
    -                   int                     theStudyId,
    -                   ::SMESH_Gen*            theGenImpl );
    +                        ::SMESH_Gen*            theGenImpl );
     
       // Destructor
       virtual ~StdMeshers_Hexa_3D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx
    index 61ec24bd4..9d6f613ea 100644
    --- a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx
    @@ -51,13 +51,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_ImportSource1D_i::StdMeshers_ImportSource1D_i( PortableServer::POA_ptr thePOA,
    -                                                          int                     theStudyId,
                                                               ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_ImportSource1D( theGenImpl->GetANewId(),
    -                                                theStudyId,
                                                     theGenImpl );
       _groupEntries = new SMESH::string_array();
     }
    @@ -87,7 +85,6 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou
       {
         std::vector smesh_groups;
         std::vector entries;
    -    SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
         for ( CORBA::ULong i = 0; i < groups.length(); ++i )
           if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast( groups[i] ))
           {
    @@ -95,7 +92,7 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou
               THROW_SALOME_CORBA_EXCEPTION("Wrong group type", SALOME::BAD_PARAM);
             smesh_groups.push_back( gp_i->GetSmeshGroup() );
     
    -        SALOMEDS::SObject_wrap so = SMESH_Gen_i::ObjectToSObject(study, groups[i]);
    +        SALOMEDS::SObject_wrap so = SMESH_Gen_i::ObjectToSObject(groups[i]);
             if ( !so->_is_nil())
             {
               CORBA::String_var entry = so->GetID();
    @@ -168,14 +165,13 @@ char* StdMeshers_ImportSource1D_i::SaveTo()
       std::ostringstream os;
       os << " " << _groupEntries->length();
     
    -  SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
       for ( size_t i = 0; i < _groupEntries->length(); ++i )
       {
         // entry
         os << " " << _groupEntries[i];
     
         // id
    -    SALOMEDS::SObject_wrap groupSO = study->FindObjectID( _groupEntries[i] );
    +    SALOMEDS::SObject_wrap groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( _groupEntries[i] );
         CORBA::Object_var     groupObj;
         if ( !groupSO->_is_nil() )
           groupObj = groupSO->GetObject();
    diff --git a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx
    index 517549d6a..2f9dca660 100644
    --- a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.hxx
    @@ -44,7 +44,6 @@ class STDMESHERS_I_EXPORT StdMeshers_ImportSource1D_i:
      public:
       // Constructor
       StdMeshers_ImportSource1D_i( PortableServer::POA_ptr thePOA,
    -                               int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_ImportSource1D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx
    index dc61b9cdd..1027d802a 100644
    --- a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx
    @@ -50,13 +50,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_ImportSource2D_i::StdMeshers_ImportSource2D_i( PortableServer::POA_ptr thePOA,
    -                                                          int                     theStudyId,
                                                               ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_ImportSource2D( theGenImpl->GetANewId(),
    -                                                theStudyId,
                                                     theGenImpl );
       _groupEntries = new SMESH::string_array();
     }
    @@ -86,7 +84,6 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou
       {
         std::vector smesh_groups;
         std::vector entries;
    -    SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
         for ( CORBA::ULong i = 0; i < groups.length(); ++i )
           if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast( groups[i] ))
           {
    @@ -94,7 +91,7 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou
               THROW_SALOME_CORBA_EXCEPTION("Wrong group type", SALOME::BAD_PARAM);
             smesh_groups.push_back( gp_i->GetSmeshGroup() );
     
    -        SALOMEDS::SObject_var so = SMESH_Gen_i::ObjectToSObject(study, groups[i]);
    +        SALOMEDS::SObject_var so = SMESH_Gen_i::ObjectToSObject(groups[i]);
             if ( !so->_is_nil())
             {
               CORBA::String_var entry = so->GetID();
    @@ -168,14 +165,13 @@ char* StdMeshers_ImportSource2D_i::SaveTo()
       std::ostringstream os;
       os << " " << _groupEntries->length();
     
    -  SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
       for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i )
       {
         // entry
         os << " " << _groupEntries[i];
     
         // id
    -    SALOMEDS::SObject_var groupSO = study->FindObjectID( _groupEntries[i] );
    +    SALOMEDS::SObject_var groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( _groupEntries[i] );
         CORBA::Object_var    groupObj;
         if ( !groupSO->_is_nil() ) {
           groupObj = groupSO->GetObject();
    diff --git a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx
    index bfa0e81b3..685dd4feb 100644
    --- a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.hxx
    @@ -44,7 +44,6 @@ class STDMESHERS_I_EXPORT StdMeshers_ImportSource2D_i:
      public:
       // Constructor
       StdMeshers_ImportSource2D_i( PortableServer::POA_ptr thePOA,
    -                               int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_ImportSource2D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_Import_1D2D_i.cxx b/src/StdMeshers_I/StdMeshers_Import_1D2D_i.cxx
    index 061257e9f..8a84e648b 100644
    --- a/src/StdMeshers_I/StdMeshers_Import_1D2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Import_1D2D_i.cxx
    @@ -37,7 +37,6 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Import_1D2D_i::StdMeshers_Import_1D2D_i (PortableServer::POA_ptr thePOA,
    -                                                    int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl)
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA ), 
    @@ -45,7 +44,6 @@ StdMeshers_Import_1D2D_i::StdMeshers_Import_1D2D_i (PortableServer::POA_ptr theP
         SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Import_1D2D(theGenImpl->GetANewId(),
    -                                            theStudyId,
                                                 theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Import_1D2D_i.hxx b/src/StdMeshers_I/StdMeshers_Import_1D2D_i.hxx
    index 5e94f1a9a..fa4f3fa01 100644
    --- a/src/StdMeshers_I/StdMeshers_Import_1D2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Import_1D2D_i.hxx
    @@ -39,7 +39,6 @@ class StdMeshers_Import_1D2D_i:
     public:
       // Constructor
       StdMeshers_Import_1D2D_i( PortableServer::POA_ptr thePOA,
    -                            int                     theStudyId,
                                 ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    diff --git a/src/StdMeshers_I/StdMeshers_Import_1D_i.cxx b/src/StdMeshers_I/StdMeshers_Import_1D_i.cxx
    index dfbda1eb9..2b3d23412 100644
    --- a/src/StdMeshers_I/StdMeshers_Import_1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Import_1D_i.cxx
    @@ -43,7 +43,6 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Import_1D_i::StdMeshers_Import_1D_i( PortableServer::POA_ptr thePOA,
    -                                                int                     theStudyId,
                                                     ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA ), 
    @@ -51,7 +50,6 @@ StdMeshers_Import_1D_i::StdMeshers_Import_1D_i( PortableServer::POA_ptr thePOA,
         SMESH_1D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Import_1D( theGenImpl->GetANewId(),
    -                                           theStudyId,
                                                theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Import_1D_i.hxx b/src/StdMeshers_I/StdMeshers_Import_1D_i.hxx
    index fb7641256..9b9fce883 100644
    --- a/src/StdMeshers_I/StdMeshers_Import_1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Import_1D_i.hxx
    @@ -42,7 +42,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Import_1D_i:
      public:
       // Constructor
       StdMeshers_Import_1D_i( PortableServer::POA_ptr thePOA,
    -                          int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_Import_1D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx b/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx
    index 013db3995..9b81cd286 100644
    --- a/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx
    @@ -36,13 +36,11 @@
     
     StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i
                                               (PortableServer::POA_ptr thePOA,
    -                                           int                     theStudyId,
                                                ::SMESH_Gen*            theGenImpl )
     :SMESH_Hypothesis_i( thePOA ),
    - StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl)
    + StdMeshers_LayerDistribution_i(thePOA, theGenImpl)
     {
       myBaseImpl = new ::StdMeshers_LayerDistribution2D(theGenImpl->GetANewId(),
    -                                                    theStudyId,
                                                         theGenImpl);
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx b/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx
    index e95c43317..a5290de0a 100644
    --- a/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx
    @@ -44,7 +44,6 @@ class StdMeshers_LayerDistribution2D_i:
     public:
       // Constructor
       StdMeshers_LayerDistribution2D_i(PortableServer::POA_ptr thePOA,
    -                                   int                     theStudyId,
                                        ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_LayerDistribution2D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
    index d8bb02180..abe9066df 100644
    --- a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
    @@ -45,13 +45,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA,
    -                                                                int                     theStudyId,
                                                                     ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_LayerDistribution( theGenImpl->GetANewId(),
    -                                                   theStudyId,
                                                        theGenImpl );
     }
     
    @@ -90,11 +88,10 @@ void StdMeshers_LayerDistribution_i::SetLayerDistribution(SMESH::SMESH_Hypothesi
         // Remove SO of 1D hypothesis if it was published
         if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen())
         {
    -      SALOMEDS::Study_var study = gen->GetCurrentStudy();
    -      SALOMEDS::SObject_var  SO = gen->ObjectToSObject( study, hyp1D );
    +      SALOMEDS::SObject_var  SO = gen->ObjectToSObject( hyp1D );
           if ( ! SO->_is_nil() )
           {
    -        SALOMEDS::StudyBuilder_var builder = study->NewBuilder();
    +        SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
             builder->RemoveObjectWithChildren( SO );
             SO->UnRegister();
           }
    @@ -198,8 +195,7 @@ void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
            is >> libName )
       {
         SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
    -    SALOMEDS::Study_var curStudy = gen->GetCurrentStudy();
    -    gen->SetCurrentStudy( SALOMEDS::Study::_nil() ); // prevent hypo publishing
    +    gen->SetEnablePublish( false ); // prevent hypo publishing
     
         try {
           SMESH::SMESH_Hypothesis_var hyp1D =
    @@ -221,7 +217,7 @@ void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
         }
         catch (...) {
         }
    -    gen->SetCurrentStudy( curStudy );  // enable hypo publishing
    +    gen->SetEnablePublish( true );  // enable hypo publishing
       }
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx
    index 98947b7cf..69050ee70 100644
    --- a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx
    @@ -50,7 +50,6 @@ class StdMeshers_LayerDistribution_i:
     public:
       // Constructor
       StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA,
    -                                  int                     theStudyId,
                                       ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_LayerDistribution_i();
    diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx
    index 7404b9e13..94b341701 100644
    --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx
    @@ -44,14 +44,12 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i( PortableServer::POA_ptr thePOA,
    -                                                  int                     theStudyId,
    -                                                  ::SMESH_Gen*            theGenImpl )
    +                                                            ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_LengthFromEdges( theGenImpl->GetANewId(),
    -                                            theStudyId,
    -                                            theGenImpl );
    +                                                 theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx
    index 5c88c7dff..98495ea09 100644
    --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx
    @@ -48,8 +48,7 @@ class STDMESHERS_I_EXPORT StdMeshers_LengthFromEdges_i:
     public:
       // Constructor
       StdMeshers_LengthFromEdges_i( PortableServer::POA_ptr thePOA,
    -                           int                     theStudyId,
    -                           ::SMESH_Gen*            theGenImpl );
    +                                ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_LengthFromEdges_i();
     
    diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx
    index af0e63a48..06270a793 100644
    --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx
    @@ -47,13 +47,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_LocalLength_i::StdMeshers_LocalLength_i( PortableServer::POA_ptr thePOA,
    -                                                    int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ),
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_LocalLength( theGenImpl->GetANewId(),
    -                                             theStudyId,
                                                  theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx
    index e3b30927e..25504ef9f 100644
    --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx
    @@ -49,8 +49,7 @@ class STDMESHERS_I_EXPORT StdMeshers_LocalLength_i:
     public:
       // Constructor
       StdMeshers_LocalLength_i( PortableServer::POA_ptr thePOA,
    -                       int                     theStudyId,
    -                       ::SMESH_Gen*            theGenImpl );
    +                            ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_LocalLength_i();
     
    diff --git a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx
    index d463a4ebe..dd98b1449 100644
    --- a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx
    @@ -44,16 +44,14 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
    -                                        int                     theStudyId,
    -                                        ::SMESH_Gen*            theGenImpl )
    +                                                  ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
            SMESH_Algo_i( thePOA ),
            SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_MEFISTO_2D( theGenImpl->GetANewId(),
    -                                       theStudyId,
    -                                       theGenImpl );
    +                                            theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx
    index 099373064..1313e4c8d 100644
    --- a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx
    @@ -50,8 +50,7 @@ class STDMESHERS_I_EXPORT StdMeshers_MEFISTO_2D_i:
     public:
       // Constructor
       StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
    -                      int                     theStudyId,
    -                      ::SMESH_Gen*            theGenImpl );
    +                           ::SMESH_Gen*            theGenImpl );
     
       // Destructor
       virtual ~StdMeshers_MEFISTO_2D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx
    index 017c33bb0..c61928156 100644
    --- a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx
    @@ -47,14 +47,12 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
    -                                                int                     theStudyId,
    -                                                ::SMESH_Gen*            theGenImpl )
    +                                                          ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ) 
     {
       myBaseImpl = new ::StdMeshers_MaxElementArea( theGenImpl->GetANewId(),
    -                                           theStudyId,
    -                                           theGenImpl );
    +                                                theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx
    index 2e46ff056..b20fb3e57 100644
    --- a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx
    @@ -47,8 +47,7 @@ class STDMESHERS_I_EXPORT StdMeshers_MaxElementArea_i:
     public:
       // Constructor
       StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
    -                          int                     theStudyId,
    -                          ::SMESH_Gen*            theGenImpl );
    +                               ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_MaxElementArea_i();
     
    diff --git a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx
    index c9861c1f6..17c19a259 100644
    --- a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx
    @@ -47,14 +47,12 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i( PortableServer::POA_ptr thePOA,
    -                                                    int                     theStudyId,
    -                                                    ::SMESH_Gen*            theGenImpl )
    +                                                              ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_MaxElementVolume( theGenImpl->GetANewId(),
    -                                             theStudyId,
    -                                             theGenImpl );
    +                                                  theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx
    index 876d8e2c4..1f917e191 100644
    --- a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx
    @@ -47,8 +47,7 @@ class STDMESHERS_I_EXPORT StdMeshers_MaxElementVolume_i:
     public:
       // Constructor
       StdMeshers_MaxElementVolume_i( PortableServer::POA_ptr thePOA,
    -                            int                     theStudyId,
    -                            ::SMESH_Gen*            theGenImpl );
    +                                 ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_MaxElementVolume_i();
     
    diff --git a/src/StdMeshers_I/StdMeshers_MaxLength_i.cxx b/src/StdMeshers_I/StdMeshers_MaxLength_i.cxx
    index f26732a57..2dbd9019a 100644
    --- a/src/StdMeshers_I/StdMeshers_MaxLength_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_MaxLength_i.cxx
    @@ -42,13 +42,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_MaxLength_i::StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
    -                                                int                     theStudyId,
                                                     ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_MaxLength( theGenImpl->GetANewId(),
    -                                           theStudyId,
                                                theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_MaxLength_i.hxx b/src/StdMeshers_I/StdMeshers_MaxLength_i.hxx
    index 4f888e1be..21de81ae3 100644
    --- a/src/StdMeshers_I/StdMeshers_MaxLength_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_MaxLength_i.hxx
    @@ -44,8 +44,7 @@ class STDMESHERS_I_EXPORT StdMeshers_MaxLength_i:
     public:
       // Constructor
       StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
    -                       int                     theStudyId,
    -                       ::SMESH_Gen*            theGenImpl );
    +                          ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_MaxLength_i();
     
    diff --git a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx
    index ba1f768c2..d8507a9df 100644
    --- a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx
    @@ -42,13 +42,11 @@ using namespace std;
     
     StdMeshers_NotConformAllowed_i::StdMeshers_NotConformAllowed_i
                                     (PortableServer::POA_ptr thePOA,
    -                                 int                     studyId,
                                      ::SMESH_Gen*            genImpl)
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_NotConformAllowed(genImpl->GetANewId(),
    -                                                  studyId,
                                                       genImpl);
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx
    index 2ee4a512d..ee4107f10 100644
    --- a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx
    @@ -44,7 +44,6 @@ class STDMESHERS_I_EXPORT StdMeshers_NotConformAllowed_i:
     {
     public:
       StdMeshers_NotConformAllowed_i(PortableServer::POA_ptr thePOA,
    -                                 int studyId,
                                      ::SMESH_Gen* genImpl);
       virtual ~StdMeshers_NotConformAllowed_i();
       
    diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx
    index 263e4d5c3..4b7ff8800 100644
    --- a/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx
    @@ -36,13 +36,11 @@
     
     StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i
                                                (PortableServer::POA_ptr thePOA,
    -                                            int                     theStudyId,
                                                 ::SMESH_Gen*            theGenImpl)
      :SMESH_Hypothesis_i( thePOA ),
    -  StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl)
    +  StdMeshers_NumberOfLayers_i(thePOA, theGenImpl)
     {
       myBaseImpl = new ::StdMeshers_NumberOfLayers2D(theGenImpl->GetANewId(),
    -                                                 theStudyId,
                                                      theGenImpl);
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx
    index e9c9b22f8..128cfca34 100644
    --- a/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx
    @@ -43,7 +43,6 @@ class StdMeshers_NumberOfLayers2D_i:
     public:
       // Constructor
       StdMeshers_NumberOfLayers2D_i( PortableServer::POA_ptr thePOA,
    -                                 int                     theStudyId,
                                      ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_NumberOfLayers2D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx
    index 40905a672..bcc117543 100644
    --- a/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx
    @@ -46,14 +46,12 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_NumberOfLayers_i::StdMeshers_NumberOfLayers_i( PortableServer::POA_ptr thePOA,
    -                                                          int                     theStudyId,
                                                               ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_NumberOfLayers( theGenImpl->GetANewId(),
    -                                                 theStudyId,
    -                                                 theGenImpl );
    +                                                theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx
    index b47b10e79..6af3b6c14 100644
    --- a/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx
    @@ -51,7 +51,6 @@ class StdMeshers_NumberOfLayers_i:
     public:
       // Constructor
       StdMeshers_NumberOfLayers_i( PortableServer::POA_ptr thePOA,
    -                               int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_NumberOfLayers_i();
    diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx
    index 5a75bf78e..20397181e 100644
    --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx
    @@ -46,14 +46,12 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
    -                                                    int                     theStudyId,
    -                                                    ::SMESH_Gen*            theGenImpl )
    +                                                              ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_NumberOfSegments( theGenImpl->GetANewId(),
    -                                             theStudyId,
    -                                             theGenImpl );
    +                                                  theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx
    index 05be9d24d..1b8f1ea18 100644
    --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx
    @@ -48,8 +48,7 @@ class STDMESHERS_I_EXPORT StdMeshers_NumberOfSegments_i:
     public:
       // Constructor
       StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
    -                            int                     theStudyId,
    -                            ::SMESH_Gen*            theGenImpl );
    +                                 ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_NumberOfSegments_i();
     
    diff --git a/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx b/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx
    index 89cca0caa..60b0772ab 100644
    --- a/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx
    +++ b/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx
    @@ -59,9 +59,8 @@ StdMeshers_ObjRefUlils::EntryOrShapeToGeomObject (const std::string&  theEntry,
     
       // try by entry
       if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
    -    SALOMEDS::Study_var study = gen->GetCurrentStudy();
    -    if ( ! theEntry.empty() && ! study->_is_nil() ) {
    -      SALOMEDS::SObject_wrap sobj = study->FindObjectID( theEntry.c_str() );
    +    if ( ! theEntry.empty() ) {
    +      SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.c_str() );
           CORBA::Object_var       obj = gen->SObjectToObject( sobj );
           geom = GEOM::GEOM_Object::_narrow( obj );
         }
    @@ -88,7 +87,7 @@ void StdMeshers_ObjRefUlils::SaveToStream( const TopoDS_Shape& theShape, ostream
         if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
           GEOM::GEOM_Object_var geom = gen->ShapeToGeomObject( theShape );
           if ( ! geom->_is_nil() ) {
    -        SALOMEDS::SObject_wrap sobj = gen->ObjectToSObject( gen->GetCurrentStudy(), geom );
    +        SALOMEDS::SObject_wrap sobj = gen->ObjectToSObject( geom );
             if ( !sobj->_is_nil() ) {
               CORBA::String_var entry = sobj->GetID();
               stream << " " << entry.in();
    @@ -117,13 +116,10 @@ TopoDS_Shape StdMeshers_ObjRefUlils::LoadFromStream( istream &    stream,
         if ( entry )
           * entry = str;
         if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
    -      SALOMEDS::Study_var study = gen->GetCurrentStudy();
    -      if ( ! study->_is_nil() ) {
    -        SALOMEDS::SObject_wrap sobj = study->FindObjectID( str.c_str() );
    -        CORBA::Object_var       obj = gen->SObjectToObject( sobj );
    -        GEOM::GEOM_Object_var  geom = GEOM::GEOM_Object::_narrow( obj );
    -        return gen->GeomObjectToShape( geom.in() );
    -      }
    +      SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( str.c_str() );
    +      CORBA::Object_var       obj = gen->SObjectToObject( sobj );
    +      GEOM::GEOM_Object_var  geom = GEOM::GEOM_Object::_narrow( obj );
    +      return gen->GeomObjectToShape( geom.in() );
         }
       }
       if ( entry )
    diff --git a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx
    index 63d6714aa..c095f95b3 100644
    --- a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx
    +++ b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx
    @@ -110,7 +110,7 @@ public:
         if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
           std::string str;
           if (stream >> str) {
    -        if ( StudyContext* myStudyContext = gen->GetCurrentStudyContext() ) {
    +        if ( StudyContext* myStudyContext = gen->GetStudyContext() ) {
               std::string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
               if ( !ior.empty() )
                  return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() ));
    diff --git a/src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.cxx b/src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.cxx
    index 4659ab42b..54b61812e 100644
    --- a/src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.cxx
    @@ -36,7 +36,6 @@
     //=============================================================================
     
     StdMeshers_PolygonPerFace_2D_i::StdMeshers_PolygonPerFace_2D_i( PortableServer::POA_ptr thePOA,
    -                                                                int                     theStudyId,
                                                                     ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA ),
    @@ -44,7 +43,6 @@ StdMeshers_PolygonPerFace_2D_i::StdMeshers_PolygonPerFace_2D_i( PortableServer::
         SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_PolygonPerFace_2D( theGenImpl->GetANewId(),
    -                                                   theStudyId,
                                                        theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.hxx b/src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.hxx
    index a9f0f314b..c32bcb737 100644
    --- a/src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_PolygonPerFace_2D_i.hxx
    @@ -45,7 +45,6 @@ class STDMESHERS_I_EXPORT StdMeshers_PolygonPerFace_2D_i:
      public:
       // Constructor
       StdMeshers_PolygonPerFace_2D_i( PortableServer::POA_ptr thePOA,
    -                                  int                     theStudyId,
                                       ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_PolygonPerFace_2D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx
    index 8f5999d65..7d5bd2712 100644
    --- a/src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx
    @@ -41,7 +41,6 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
    -                                              int                     theStudyId,
                                                   ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA ),
    @@ -49,7 +48,6 @@ StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
         SMESH_3D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Prism_3D( theGenImpl->GetANewId(),
    -                                          theStudyId,
                                               theGenImpl );
     }
     //-----------------------------------------------------------------------------
    @@ -79,7 +77,6 @@ CORBA::Boolean StdMeshers_Prism_3D_i::IsApplicable( const TopoDS_Shape &S,
     //=============================================================================
     
     StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
    -                                                          int                     theStudyId,
                                                               ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA ),
    @@ -87,7 +84,6 @@ StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_pt
         SMESH_3D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_RadialPrism_3D( theGenImpl->GetANewId(),
    -                                                theStudyId,
                                                     theGenImpl );
     }
     //-----------------------------------------------------------------------------
    diff --git a/src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx b/src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx
    index 5cecfcd3b..985b34615 100644
    --- a/src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx
    @@ -48,7 +48,6 @@ class StdMeshers_Prism_3D_i:
     public:
       // Constructor
       StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
    -                         int                     theStudyId,
                              ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    @@ -71,7 +70,6 @@ class StdMeshers_RadialPrism_3D_i:
     public:
       // Constructor
       StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
    -                               int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx
    index 6067de55b..7b4048662 100644
    --- a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx
    @@ -48,12 +48,10 @@ using namespace std;
     
     StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i
     ( PortableServer::POA_ptr thePOA,
    -  int                     theStudyId,
       ::SMESH_Gen*            theGenImpl ) : SALOME::GenericObj_i( thePOA ), 
                                              SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_ProjectionSource1D( theGenImpl->GetANewId(),
    -                                                    theStudyId,
                                                         theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx
    index 2a818f201..024ccb634 100644
    --- a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx
    @@ -52,7 +52,6 @@ class StdMeshers_ProjectionSource1D_i:
     public:
       // Constructor
       StdMeshers_ProjectionSource1D_i( PortableServer::POA_ptr thePOA,
    -                                   int                     theStudyId,
                                        ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_ProjectionSource1D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx
    index 369cc29df..ff0364603 100644
    --- a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx
    @@ -48,12 +48,10 @@ using namespace std;
     
     StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i
     ( PortableServer::POA_ptr thePOA,
    -  int                     theStudyId,
       ::SMESH_Gen*            theGenImpl ) : SALOME::GenericObj_i( thePOA ), 
                                              SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_ProjectionSource2D( theGenImpl->GetANewId(),
    -                                                    theStudyId,
                                                         theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx
    index eb929dc49..add3b78ff 100644
    --- a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx
    @@ -52,7 +52,6 @@ class StdMeshers_ProjectionSource2D_i:
     public:
       // Constructor
       StdMeshers_ProjectionSource2D_i( PortableServer::POA_ptr thePOA,
    -                                   int                     theStudyId,
                                        ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_ProjectionSource2D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx
    index 195fafc65..062602d89 100644
    --- a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx
    @@ -48,12 +48,10 @@ using namespace std;
     
     StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i
     ( PortableServer::POA_ptr thePOA,
    -  int                     theStudyId,
       ::SMESH_Gen*            theGenImpl ) : SALOME::GenericObj_i( thePOA ), 
                                              SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_ProjectionSource3D( theGenImpl->GetANewId(),
    -                                                    theStudyId,
                                                         theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx
    index 69d658827..47458062e 100644
    --- a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx
    @@ -53,7 +53,6 @@ class StdMeshers_ProjectionSource3D_i:
     public:
       // Constructor
       StdMeshers_ProjectionSource3D_i( PortableServer::POA_ptr thePOA,
    -                                   int                     theStudyId,
                                        ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_ProjectionSource3D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx
    index 515b7e85b..d9b135b0b 100644
    --- a/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx
    @@ -40,7 +40,6 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i( PortableServer::POA_ptr thePOA,
    -                                                        int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -48,8 +47,7 @@ StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i( PortableServer::POA_ptr
            SMESH_3D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Projection_3D( theGenImpl->GetANewId(),
    -                                    theStudyId,
    -                                    theGenImpl );
    +                                               theGenImpl );
     }
     //-----------------------------------------------------------------------------
     
    @@ -82,7 +80,6 @@ CORBA::Boolean StdMeshers_Projection_3D_i::IsApplicable(const TopoDS_Shape &S,
     //=============================================================================
     
     StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i( PortableServer::POA_ptr thePOA,
    -                                                        int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -90,8 +87,7 @@ StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i( PortableServer::POA_ptr
            SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Projection_2D( theGenImpl->GetANewId(),
    -                                    theStudyId,
    -                                    theGenImpl );
    +                                               theGenImpl );
     }
     //-----------------------------------------------------------------------------
     
    @@ -113,7 +109,6 @@ StdMeshers_Projection_2D_i::~StdMeshers_Projection_2D_i()
     //=============================================================================
     
     StdMeshers_Projection_1D2D_i::StdMeshers_Projection_1D2D_i( PortableServer::POA_ptr thePOA,
    -                                                            int                     theStudyId,
                                                                 ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ),
            SMESH_Hypothesis_i( thePOA ),
    @@ -121,7 +116,6 @@ StdMeshers_Projection_1D2D_i::StdMeshers_Projection_1D2D_i( PortableServer::POA_
            SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Projection_1D2D( theGenImpl->GetANewId(),
    -                                                 theStudyId,
                                                      theGenImpl );
     }
     //-----------------------------------------------------------------------------
    @@ -144,7 +138,6 @@ StdMeshers_Projection_1D2D_i::~StdMeshers_Projection_1D2D_i()
     //=============================================================================
     
     StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i( PortableServer::POA_ptr thePOA,
    -                                                        int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -152,8 +145,7 @@ StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i( PortableServer::POA_ptr
            SMESH_1D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Projection_1D( theGenImpl->GetANewId(),
    -                                    theStudyId,
    -                                    theGenImpl );
    +                                               theGenImpl );
     }
     //-----------------------------------------------------------------------------
     
    diff --git a/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx b/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx
    index d56f02c51..1aa53b802 100644
    --- a/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx
    @@ -50,7 +50,6 @@ class StdMeshers_Projection_3D_i:
     public:
       // Constructor
       StdMeshers_Projection_3D_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    @@ -74,7 +73,6 @@ class StdMeshers_Projection_2D_i:
     public:
       // Constructor
       StdMeshers_Projection_2D_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    @@ -95,7 +93,6 @@ class StdMeshers_Projection_1D2D_i:
     public:
       // Constructor
       StdMeshers_Projection_1D2D_i( PortableServer::POA_ptr thePOA,
    -                                int                     theStudyId,
                                     ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    @@ -116,7 +113,6 @@ class StdMeshers_Projection_1D_i:
     public:
       // Constructor
       StdMeshers_Projection_1D_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    diff --git a/src/StdMeshers_I/StdMeshers_Propagation_i.cxx b/src/StdMeshers_I/StdMeshers_Propagation_i.cxx
    index 6d086c514..bbdef0825 100644
    --- a/src/StdMeshers_I/StdMeshers_Propagation_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Propagation_i.cxx
    @@ -40,13 +40,11 @@ using namespace std;
      */
     //=============================================================================
     StdMeshers_Propagation_i::StdMeshers_Propagation_i (PortableServer::POA_ptr thePOA,
    -                                                    int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Propagation(theGenImpl->GetANewId(),
    -                                            theStudyId,
                                                 theGenImpl);
     }
     
    @@ -73,13 +71,11 @@ CORBA::Boolean StdMeshers_Propagation_i::IsDimSupported( SMESH::Dimension type )
     //=============================================================================
     StdMeshers_PropagOfDistribution_i::
     StdMeshers_PropagOfDistribution_i (PortableServer::POA_ptr thePOA,
    -                                   int                     theStudyId,
                                        ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_PropagOfDistribution(theGenImpl->GetANewId(),
    -                                                     theStudyId,
                                                          theGenImpl);
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Propagation_i.hxx b/src/StdMeshers_I/StdMeshers_Propagation_i.hxx
    index 00e07de4c..e2696dd3a 100644
    --- a/src/StdMeshers_I/StdMeshers_Propagation_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Propagation_i.hxx
    @@ -48,7 +48,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Propagation_i:
     public:
       // Constructor
       StdMeshers_Propagation_i (PortableServer::POA_ptr thePOA,
    -                            int                     theStudyId,
                                 ::SMESH_Gen*            theGenImpl);
       
       // Verify whether hypothesis supports given entity type 
    @@ -66,7 +65,6 @@ class STDMESHERS_I_EXPORT StdMeshers_PropagOfDistribution_i:
     public:
       // Constructor
       StdMeshers_PropagOfDistribution_i (PortableServer::POA_ptr thePOA,
    -                                     int                     theStudyId,
                                          ::SMESH_Gen*            theGenImpl);
       
       // Verify whether hypothesis supports given entity type 
    diff --git a/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx b/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx
    index 1681544fa..78b2841e1 100644
    --- a/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.cxx
    @@ -45,13 +45,11 @@ using namespace std;
     
     StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
                                               (PortableServer::POA_ptr thePOA,
    -                                           int                     theStudyId,
                                                ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
    -                                                 theStudyId,
                                                      theGenImpl);
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx b/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx
    index 12c209f40..227dd86af 100644
    --- a/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_QuadrangleParams_i.hxx
    @@ -41,7 +41,6 @@ class STDMESHERS_I_EXPORT StdMeshers_QuadrangleParams_i:
     public:
       // Constructor
       StdMeshers_QuadrangleParams_i (PortableServer::POA_ptr thePOA,
    -                                 int                     theStudyId,
                                      ::SMESH_Gen*            theGenImpl);
       // Destructor
       virtual ~StdMeshers_QuadrangleParams_i();
    diff --git a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx
    index 9fe0b11cb..4752a3524 100644
    --- a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx
    @@ -47,12 +47,10 @@ using namespace std;
     
     StdMeshers_QuadranglePreference_i::StdMeshers_QuadranglePreference_i
     ( PortableServer::POA_ptr thePOA,
    -  int                     theStudyId,
       ::SMESH_Gen*            theGenImpl ): SALOME::GenericObj_i( thePOA ), 
                                             SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_QuadranglePreference( theGenImpl->GetANewId(),
    -                                                      theStudyId,
                                                           theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx
    index a60e976bd..bce152a69 100644
    --- a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx
    @@ -49,7 +49,6 @@ class STDMESHERS_I_EXPORT StdMeshers_QuadranglePreference_i:
     public:
       // Constructor
       StdMeshers_QuadranglePreference_i( PortableServer::POA_ptr thePOA,
    -                                     int                     theStudyId,
                                          ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_QuadranglePreference_i();
    diff --git a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx
    index 0aa84775a..c800dabff 100644
    --- a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx
    @@ -45,7 +45,6 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
    -                                                        int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA ),
    @@ -53,7 +52,6 @@ StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr
         SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Quadrangle_2D( theGenImpl->GetANewId(),
    -                                               theStudyId,
                                                    theGenImpl );
     }
     
    @@ -107,7 +105,6 @@ CORBA::Boolean StdMeshers_Quadrangle_2D_i::IsApplicable( const TopoDS_Shape &S,
     
     StdMeshers_QuadFromMedialAxis_1D2D_i::
     StdMeshers_QuadFromMedialAxis_1D2D_i( PortableServer::POA_ptr thePOA,
    -                                      int                     theStudyId,
                                           ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA ),
    @@ -115,7 +112,6 @@ StdMeshers_QuadFromMedialAxis_1D2D_i( PortableServer::POA_ptr thePOA,
         SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_QuadFromMedialAxis_1D2D( theGenImpl->GetANewId(),
    -                                                         theStudyId,
                                                              theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx
    index 4cdc9017e..83ff12d30 100644
    --- a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx
    @@ -49,7 +49,6 @@ class STDMESHERS_I_EXPORT StdMeshers_Quadrangle_2D_i:
      public:
       // Constructor
       StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    @@ -72,7 +71,6 @@ class STDMESHERS_I_EXPORT StdMeshers_QuadFromMedialAxis_1D2D_i:
      public:
       // Constructor
       StdMeshers_QuadFromMedialAxis_1D2D_i( PortableServer::POA_ptr thePOA,
    -                                        int                     theStudyId,
                                             ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    diff --git a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.cxx b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.cxx
    index 24dd38aa3..501255412 100644
    --- a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.cxx
    @@ -48,12 +48,10 @@ using namespace std;
     
     StdMeshers_QuadraticMesh_i::StdMeshers_QuadraticMesh_i
     ( PortableServer::POA_ptr thePOA,
    -  int                     theStudyId,
       ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_QuadraticMesh( theGenImpl->GetANewId(),
    -                                               theStudyId,
                                                    theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx
    index 785934aef..878816743 100644
    --- a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx
    @@ -50,7 +50,6 @@ class STDMESHERS_I_EXPORT StdMeshers_QuadraticMesh_i:
     public:
       // Constructor
       StdMeshers_QuadraticMesh_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_QuadraticMesh_i();
    diff --git a/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx b/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx
    index 1bb991a8b..889d86505 100644
    --- a/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx
    @@ -38,7 +38,6 @@ using namespace std;
     
     StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i
                                                (PortableServer::POA_ptr thePOA,
    -                                            int                     theStudyId,
                                                 ::SMESH_Gen*            theGenImpl)
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -46,7 +45,6 @@ StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i
            SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_RadialQuadrangle_1D2D(theGenImpl->GetANewId(),
    -                                                      theStudyId,
                                                           theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.hxx b/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.hxx
    index 63242f0f6..24944087f 100644
    --- a/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.hxx
    @@ -39,7 +39,6 @@ class StdMeshers_RadialQuadrangle_1D2D_i:
     public:
       // Constructor
       StdMeshers_RadialQuadrangle_1D2D_i( PortableServer::POA_ptr thePOA,
    -                                      int                     theStudyId,
                                           ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    diff --git a/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx b/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx
    index 02f83b3c2..05dd3c2ed 100644
    --- a/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx
    @@ -43,7 +43,6 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_Regular_1D_i::StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA,
    -                                                  int                     theStudyId,
                                                       ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -51,7 +50,6 @@ StdMeshers_Regular_1D_i::StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA
            SMESH_1D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_Regular_1D( theGenImpl->GetANewId(),
    -                                            theStudyId,
                                                 theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx b/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx
    index 7b83fa961..8fd4a83e4 100644
    --- a/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx
    @@ -47,8 +47,7 @@ class STDMESHERS_I_EXPORT StdMeshers_Regular_1D_i:
     public:
       // Constructor
       StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA,
    -                      int                     theStudyId,
    -                      ::SMESH_Gen*            theGenImpl );
    +                           ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_Regular_1D_i();
      
    diff --git a/src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.cxx b/src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.cxx
    index 57cbb7071..9ddfea9c1 100644
    --- a/src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.cxx
    @@ -44,7 +44,6 @@ using namespace std;
     
     StdMeshers_SegmentAroundVertex_0D_i::StdMeshers_SegmentAroundVertex_0D_i
                                                    ( PortableServer::POA_ptr thePOA,
    -                                                 int                     theStudyId,
                                                      ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -52,7 +51,6 @@ StdMeshers_SegmentAroundVertex_0D_i::StdMeshers_SegmentAroundVertex_0D_i
            SMESH_0D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_SegmentAroundVertex_0D( theGenImpl->GetANewId(),
    -                                                        theStudyId,
                                                             theGenImpl );
     }
     //-----------------------------------------------------------------------------
    diff --git a/src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.hxx b/src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.hxx
    index dea48624a..daba7fde3 100644
    --- a/src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_SegmentAroundVertex_0D_i.hxx
    @@ -43,8 +43,7 @@ class StdMeshers_SegmentAroundVertex_0D_i:
     public:
       // Constructor
       StdMeshers_SegmentAroundVertex_0D_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
    -                              ::SMESH_Gen*            theGenImpl );
    +                                       ::SMESH_Gen*            theGenImpl );
     
       // Destructor
       virtual ~StdMeshers_SegmentAroundVertex_0D_i();
    diff --git a/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.cxx b/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.cxx
    index 5801115bb..b8f52e7fe 100644
    --- a/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.cxx
    @@ -45,13 +45,11 @@ using namespace std;
     
     StdMeshers_SegmentLengthAroundVertex_i::StdMeshers_SegmentLengthAroundVertex_i
                                                         ( PortableServer::POA_ptr thePOA,
    -                                                      int                     theStudyId,
                                                           ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_SegmentLengthAroundVertex( theGenImpl->GetANewId(),
    -                                                           theStudyId,
                                                                theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx b/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx
    index c61971f02..572ed5c81 100644
    --- a/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx
    @@ -46,7 +46,6 @@ class StdMeshers_SegmentLengthAroundVertex_i:
     public:
       // Constructor
       StdMeshers_SegmentLengthAroundVertex_i( PortableServer::POA_ptr thePOA,
    -                                          int                     theStudyId,
                                               ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_SegmentLengthAroundVertex_i();
    diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx
    index 8d1edd67f..fdceff6a4 100644
    --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx
    @@ -47,14 +47,12 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i( PortableServer::POA_ptr thePOA,
    -                                                         int                     theStudyId,
    -                                                         ::SMESH_Gen*            theGenImpl )
    +                                                          ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_StartEndLength( theGenImpl->GetANewId(),
    -                                               theStudyId,
    -                                               theGenImpl );
    +                                                theGenImpl );
     }
     
     //=============================================================================
    diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx
    index 9a9f3a17b..50cd8917b 100644
    --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx
    @@ -49,7 +49,6 @@ class STDMESHERS_I_EXPORT StdMeshers_StartEndLength_i:
     public:
       // Constructor
       StdMeshers_StartEndLength_i(PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_StartEndLength_i();
    diff --git a/src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.cxx b/src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.cxx
    index ce339913d..57c4cde50 100644
    --- a/src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.cxx
    @@ -38,7 +38,6 @@
     
     StdMeshers_UseExisting_1D_i::StdMeshers_UseExisting_1D_i
                                                    ( PortableServer::POA_ptr thePOA,
    -                                                 int                     theStudyId,
                                                      ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -46,7 +45,6 @@ StdMeshers_UseExisting_1D_i::StdMeshers_UseExisting_1D_i
            SMESH_1D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_UseExisting_1D( theGenImpl->GetANewId(),
    -                                                theStudyId,
                                                     theGenImpl );
     }
     //-----------------------------------------------------------------------------
    @@ -70,7 +68,6 @@ StdMeshers_UseExisting_1D_i::~StdMeshers_UseExisting_1D_i()
     
     StdMeshers_UseExisting_2D_i::StdMeshers_UseExisting_2D_i
                                                    ( PortableServer::POA_ptr thePOA,
    -                                                 int                     theStudyId,
                                                      ::SMESH_Gen*            theGenImpl )
          : SALOME::GenericObj_i( thePOA ), 
            SMESH_Hypothesis_i( thePOA ), 
    @@ -78,7 +75,6 @@ StdMeshers_UseExisting_2D_i::StdMeshers_UseExisting_2D_i
            SMESH_2D_Algo_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_UseExisting_2D( theGenImpl->GetANewId(),
    -                                                theStudyId,
                                                     theGenImpl );
     }
     //-----------------------------------------------------------------------------
    diff --git a/src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.hxx b/src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.hxx
    index 69f1d337d..fe91a33c5 100644
    --- a/src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_UseExisting_1D2D_i.hxx
    @@ -46,7 +46,6 @@ class StdMeshers_UseExisting_1D_i:
     public:
       // Constructor
       StdMeshers_UseExisting_1D_i( PortableServer::POA_ptr thePOA,
    -                               int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    @@ -63,7 +62,6 @@ class StdMeshers_UseExisting_2D_i:
     public:
       // Constructor
       StdMeshers_UseExisting_2D_i( PortableServer::POA_ptr thePOA,
    -                               int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl );
     
       // Destructor
    diff --git a/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx b/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx
    index fb0bbbcfd..638d03d95 100644
    --- a/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.cxx
    @@ -47,13 +47,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_ViscousLayers2D_i::StdMeshers_ViscousLayers2D_i( PortableServer::POA_ptr thePOA,
    -                                                            int                     theStudyId,
                                                                 ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ),
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_ViscousLayers2D( theGenImpl->GetANewId(),
    -                                                 theStudyId,
                                                      theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx b/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx
    index e13d2a905..0b28e8597 100644
    --- a/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_ViscousLayers2D_i.hxx
    @@ -43,8 +43,7 @@ class STDMESHERS_I_EXPORT StdMeshers_ViscousLayers2D_i:
      public:
       // Constructor
       StdMeshers_ViscousLayers2D_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
    -                              ::SMESH_Gen*            theGenImpl );
    +                                ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_ViscousLayers2D_i();
     
    diff --git a/src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx b/src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx
    index ee39c26da..fc06bfdb3 100644
    --- a/src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx
    @@ -48,13 +48,11 @@ using namespace std;
     //=============================================================================
     
     StdMeshers_ViscousLayers_i::StdMeshers_ViscousLayers_i( PortableServer::POA_ptr thePOA,
    -                                                        int                     theStudyId,
                                                             ::SMESH_Gen*            theGenImpl )
       : SALOME::GenericObj_i( thePOA ), 
         SMESH_Hypothesis_i( thePOA )
     {
       myBaseImpl = new ::StdMeshers_ViscousLayers( theGenImpl->GetANewId(),
    -                                               theStudyId,
                                                    theGenImpl );
     }
     
    diff --git a/src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx b/src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx
    index fe6bef741..19f5835b0 100644
    --- a/src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx
    +++ b/src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx
    @@ -43,7 +43,6 @@ class STDMESHERS_I_EXPORT StdMeshers_ViscousLayers_i:
      public:
       // Constructor
       StdMeshers_ViscousLayers_i( PortableServer::POA_ptr thePOA,
    -                              int                     theStudyId,
                                   ::SMESH_Gen*            theGenImpl );
       // Destructor
       virtual ~StdMeshers_ViscousLayers_i();
    diff --git a/src/StdMeshers_I/StdMeshers_i.cxx b/src/StdMeshers_I/StdMeshers_i.cxx
    index b94ca0a0f..b2f238220 100644
    --- a/src/StdMeshers_I/StdMeshers_i.cxx
    +++ b/src/StdMeshers_I/StdMeshers_i.cxx
    @@ -113,11 +113,10 @@ class QuadrangleParamsCreator : public StdHypothesisCreator_iSetQuadType( TYPE );
         return h;
       }
    diff --git a/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py b/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py
    index e7a1d5ddd..e7603d916 100644
    --- a/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py
    +++ b/src/Tools/MGCleanerPlug/MGCleanerMonPlugDialog.py
    @@ -157,13 +157,12 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
         import SMESH
         from salome.kernel import studyedit
         from salome.smesh import smeshBuilder
    -    smesh = smeshBuilder.New(salome.myStudy)
    +    smesh = smeshBuilder.New()
         
         if not os.path.isfile(self.fichierOut):
           QMessageBox.warning(self, "Compute", "Result file "+self.fichierOut+" not found")
     
    -    maStudy=studyedit.getActiveStudy()
    -    smesh.SetCurrentStudy(maStudy)
    +    maStudy=salome.myStudy
         (outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
         name=str(self.LE_MeshSmesh.text())
         initialMeshFile=None
    @@ -205,7 +204,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
         newLink=monStudyBuilder.NewObject(SOMesh)
         monStudyBuilder.Addreference(newLink, newStudyIter)
     
    -    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
    +    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
         self.num+=1
         return True
     
    @@ -263,7 +262,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
         ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
         ACmt.SetValue(datai)
     
    -    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
    +    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
         self.num += 1
         if verbose: print("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai))
         return True
    @@ -281,10 +280,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
         QMessageBox.warning(self, "Save", "waiting for fix: Object Browser will not display hypothesis")
         
         if verbose: print("save hypothesis in Object Browser")
    -    smesh = smeshBuilder.New(salome.myStudy)
    +    smesh = smeshBuilder.New()
     
    -    maStudy=studyedit.getActiveStudy()
    -    smesh.SetCurrentStudy(maStudy)
    +    maStudy=salome.myStudy
     
         self.editor = studyedit.getStudyEditor()
         moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
    @@ -307,7 +305,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
         notebook.set("MGCleaner_%i" % self.num, data)
         """
     
    -    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
    +    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
         self.num += 1
         if verbose: print("save %s in Object Browser done:\n%s" % (name, data))
         return True
    @@ -497,7 +495,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
         from salome.smesh.smeshstudytools import SMeshStudyTools
         from salome.gui import helper as guihelper
         from salome.smesh import smeshBuilder
    -    smesh = smeshBuilder.New(salome.myStudy)
    +    smesh = smeshBuilder.New()
     
         mySObject, myEntry = guihelper.getSObjectSelected()
         if CORBA.is_nil(mySObject) or mySObject==None:
    @@ -642,7 +640,7 @@ def TEST_standalone():
       import SMESH
       from salome.kernel import studyedit
       salome.salome_init()
    -  maStudy=studyedit.getActiveStudy()
    +  maStudy=salome.myStudy
       #etc...a mano...
     
     #
    diff --git a/src/Tools/MGCleanerPlug/MGCleanerplug_plugin.py b/src/Tools/MGCleanerPlug/MGCleanerplug_plugin.py
    index 89c194f59..b48777839 100644
    --- a/src/Tools/MGCleanerPlug/MGCleanerplug_plugin.py
    +++ b/src/Tools/MGCleanerPlug/MGCleanerplug_plugin.py
    @@ -22,9 +22,8 @@
     # if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
     
     def MGCleanerLct(context):
    -  # get context study, studyId, salomeGui
    +  # get context study, salomeGui
       study = context.study
    -  studyId = context.studyId
       sg = context.sg
       
       import os
    diff --git a/src/Tools/MacMesh/MacMesh/CutnGroup.py b/src/Tools/MacMesh/MacMesh/CutnGroup.py
    index f7f250637..31fd9fb7b 100644
    --- a/src/Tools/MacMesh/MacMesh/CutnGroup.py
    +++ b/src/Tools/MacMesh/MacMesh/CutnGroup.py
    @@ -24,7 +24,7 @@
     import math, Config
     
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New( Config.theStudy )
    +geompy = geomBuilder.New()
     
     def Go(GeoObj, CutPlnLst, OutLvlLst, PrefixLst, Publish):
     
    diff --git a/src/Tools/MacMesh/MacMesh/GenFunctions.py b/src/Tools/MacMesh/MacMesh/GenFunctions.py
    index 71ac373e9..772b3ecf5 100644
    --- a/src/Tools/MacMesh/MacMesh/GenFunctions.py
    +++ b/src/Tools/MacMesh/MacMesh/GenFunctions.py
    @@ -27,10 +27,10 @@ import CutnGroup
     import CompositeBox
     
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New( Config.theStudy )
    +geompy = geomBuilder.New()
     
     from salome.smesh import smeshBuilder
    -smesh = smeshBuilder.New( Config.theStudy )
    +smesh = smeshBuilder.New()
     
     ##########################################################################################################
     
    diff --git a/src/Tools/MacMesh/MacMesh/MacObject.py b/src/Tools/MacMesh/MacMesh/MacObject.py
    index 6589ac8b0..9b1aadf9d 100644
    --- a/src/Tools/MacMesh/MacMesh/MacObject.py
    +++ b/src/Tools/MacMesh/MacMesh/MacObject.py
    @@ -241,7 +241,7 @@ class MacObject:
                     import GenFunctions, Config
     
                     from salome.geom import geomBuilder
    -                geompy = geomBuilder.New( Config.theStudy )
    +                geompy = geomBuilder.New()
                     
                     if type(Criterion) is str :
                             Crit = {'South'  : lambda : 0,
    diff --git a/src/Tools/MacMesh/MacMesh/PublishGroups.py b/src/Tools/MacMesh/MacMesh/PublishGroups.py
    index 31f2b7329..219e0ee56 100644
    --- a/src/Tools/MacMesh/MacMesh/PublishGroups.py
    +++ b/src/Tools/MacMesh/MacMesh/PublishGroups.py
    @@ -23,10 +23,10 @@ import math
     import Config
     
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New( Config.theStudy )
    +geompy = geomBuilder.New()
     
     from salome.smesh import smeshBuilder
    -smesh = smeshBuilder.New( Config.theStudy )
    +smesh = smeshBuilder.New()
     
     ##########################################################################################################
     
    diff --git a/src/Tools/MeshCut/meshcut_plugin.py b/src/Tools/MeshCut/meshcut_plugin.py
    index c5abe768a..7f47b61a5 100644
    --- a/src/Tools/MeshCut/meshcut_plugin.py
    +++ b/src/Tools/MeshCut/meshcut_plugin.py
    @@ -21,9 +21,8 @@
     # if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
     
     def MeshCut(context):
    -  # get context study, studyId, salomeGui
    +  # get context study, salomeGui
       study = context.study
    -  studyId = context.studyId
       sg = context.sg
       
       import os
    diff --git a/src/Tools/Verima/Doc/usage_outil.rst b/src/Tools/Verima/Doc/usage_outil.rst
    index 29376b600..cd8d02a16 100644
    --- a/src/Tools/Verima/Doc/usage_outil.rst
    +++ b/src/Tools/Verima/Doc/usage_outil.rst
    @@ -137,7 +137,7 @@ Modifier les scripts pour les intégrer dans le mécanisme de test
                 fichierMedResult = 'fichierMed.med'
                 getStatsMaillage(monMaillage,fichierMedResult)
                 getStatsGroupes(monMaillage,fichierMedResult)
    -            getStatsCritere(dimMaillage,monMaillage,fichierMedResult,theStudy)
    +            getStatsCritere(dimMaillage,monMaillage,fichierMedResult)
     
     Lancement du script de comparaison
     -----------------------------------
    diff --git a/src/Tools/Verima/Stats/getCritere.py b/src/Tools/Verima/Stats/getCritere.py
    index 16239e170..6dcc3345b 100644
    --- a/src/Tools/Verima/Stats/getCritere.py
    +++ b/src/Tools/Verima/Stats/getCritere.py
    @@ -6,10 +6,10 @@ import salome
     from getStats import getGroupesRef
     from Type_Maille import dicoDimENtite
     
    -def getCritere(dim,NomMesh,acritere,theStudy):
    +def getCritere(dim,NomMesh,acritere):
       import SMESH
       from salome.smesh import smeshBuilder
    -  smesh = smeshBuilder.New(theStudy)
    +  smesh = smeshBuilder.New()
       import numpy
     #  print dim,NomMesh,acritere
       if dim == 2 :
    @@ -36,10 +36,10 @@ def getCritere(dim,NomMesh,acritere,theStudy):
       
       return [max,min,Q1,M,Q3,moyenne]
     
    -def getCritereGroupe(NomMesh,NomGr,acritere,theStudy):
    +def getCritereGroupe(NomMesh,NomGr,acritere):
       import SMESH
       from salome.smesh import smeshBuilder
    -  smesh = smeshBuilder.New(theStudy)
    +  smesh = smeshBuilder.New()
       import numpy
         
       # on ne traite que les mailles 2D et 3D
    @@ -72,7 +72,7 @@ def getCritereGroupe(NomMesh,NomGr,acritere,theStudy):
       
       return [max,min,Q1,M,Q3,moyenne]
     
    -def getObjectsGroupe(Mesh,liste,theStudy):
    +def getObjectsGroupe(Mesh,liste):
       import SMESH
       from salome.smesh import smeshBuilder
       dico={}
    @@ -83,29 +83,29 @@ def getObjectsGroupe(Mesh,liste,theStudy):
               if name == n :  dico[name]=g
       return dico
     
    -def getStatsCritere(dim,Mesh,fichierMedResult,theStudy):
    +def getStatsCritere(dim,Mesh,fichierMedResult):
       fichierStatRatio=fichierMedResult.replace('.med','.ratio')
    -  max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Ratio",theStudy)
    +  max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Ratio")
       f = open(fichierStatRatio, 'w')
       f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
       f.close()
     
       fichierStatRatio=fichierMedResult.replace('.med','.taille')
    -  max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Length",theStudy)
    +  max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Length")
       f = open(fichierStatRatio, 'w')
       f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
       f.close()
     
       liste=getGroupesRef(fichierMedResult)
    -  dicoGroupe=getObjectsGroupe(Mesh,liste,theStudy)
    +  dicoGroupe=getObjectsGroupe(Mesh,liste)
       for groupe in liste :
    -      max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Ratio",theStudy)
    +      max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Ratio")
           extension="_"+groupe+'_Ratio.res'
           fichier=fichierMedResult.replace('.med',extension)
           f = open(fichier, 'w')
           f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
           f.close()
    -      max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Length",theStudy)
    +      max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Length")
           extension="_"+groupe+'_Taille.res'
           fichier=fichierMedResult.replace('.med',extension)
           f = open(fichier, 'w')
    diff --git a/src/Tools/YamsPlug/monYamsPlugDialog.py b/src/Tools/YamsPlug/monYamsPlugDialog.py
    index efdaa3154..29754d4b4 100644
    --- a/src/Tools/YamsPlug/monYamsPlugDialog.py
    +++ b/src/Tools/YamsPlug/monYamsPlugDialog.py
    @@ -130,13 +130,13 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
         import SMESH
         from salome.kernel import studyedit
         from salome.smesh import smeshBuilder
    -    smesh = smeshBuilder.New(salome.myStudy)
    +    smesh = smeshBuilder.New()
         
         if not os.path.isfile(self.fichierOut):
           QMessageBox.warning(self, "Compute", "Result file "+self.fichierOut+" not found")
     
    -    maStudy=studyedit.getActiveStudy()
    -    smesh.SetCurrentStudy(maStudy)
    +    maStudy=salome.myStudy
    +    smesh.UpdateStudy()
         (outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
         name=str(self.LE_MeshSmesh.text())
         initialMeshFile=None
    @@ -178,7 +178,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
         newLink=monStudyBuilder.NewObject(SOMesh)
         monStudyBuilder.Addreference(newLink, newStudyIter)
     
    -    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
    +    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
         self.num+=1
         return True
     
    @@ -236,7 +236,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
         ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
         ACmt.SetValue(datai)
     
    -    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
    +    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
         self.num += 1
         if verbose: print("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai))
         return True
    @@ -254,10 +254,10 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
         QMessageBox.warning(self, "Save", "waiting for fix: Object Browser will not display hypothesis")
         
         if verbose: print("save hypothesis in Object Browser")
    -    smesh = smeshBuilder.New(salome.myStudy)
    +    smesh = smeshBuilder.New()
     
    -    maStudy=studyedit.getActiveStudy()
    -    smesh.SetCurrentStudy(maStudy)
    +    maStudy=salome.myStudy
    +    smesh.UpdateStudy()
     
         self.editor = studyedit.getStudyEditor()
         moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
    @@ -273,7 +273,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
         data = self.getResumeData(separator=" ; ")
         self.editor.setAttributeValue(newStudyIter, "AttributeComment", data)
         
    -    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
    +    if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
         self.num += 1
         if verbose: print("save %s in Object Browser done:\n%s" % (name, data))
         return True
    @@ -452,7 +452,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
         from salome.smesh.smeshstudytools import SMeshStudyTools
         from salome.gui import helper as guihelper
         from salome.smesh import smeshBuilder
    -    smesh = smeshBuilder.New(salome.myStudy)
    +    smesh = smeshBuilder.New()
     
         mySObject, myEntry = guihelper.getSObjectSelected()
         if CORBA.is_nil(mySObject) or mySObject==None:
    diff --git a/src/Tools/YamsPlug/yamsplug_plugin.py b/src/Tools/YamsPlug/yamsplug_plugin.py
    index 20eea53c6..afaa40f3a 100755
    --- a/src/Tools/YamsPlug/yamsplug_plugin.py
    +++ b/src/Tools/YamsPlug/yamsplug_plugin.py
    @@ -22,9 +22,8 @@
     # if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
     
     def YamsLct(context):
    -  # get context study, studyId, salomeGui
    +  # get context study, salomeGui
       study = context.study
    -  studyId = context.studyId
       sg = context.sg
       
       import os
    diff --git a/src/Tools/blocFissure/AREextradosLauncher.py b/src/Tools/blocFissure/AREextradosLauncher.py
    index 40e34cea8..2c91f460a 100644
    --- a/src/Tools/blocFissure/AREextradosLauncher.py
    +++ b/src/Tools/blocFissure/AREextradosLauncher.py
    @@ -33,4 +33,4 @@ dicoParams = dict(nomCas            = 'fissTuyau',
     execInstance = casStandard(dicoParams)
     
     if salome.sg.hasDesktop():
    -    salome.sg.updateObjBrowser(True)
    +    salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/AREintradosLauncher.py b/src/Tools/blocFissure/AREintradosLauncher.py
    index dc834acd9..a8fa04b3d 100644
    --- a/src/Tools/blocFissure/AREintradosLauncher.py
    +++ b/src/Tools/blocFissure/AREintradosLauncher.py
    @@ -33,4 +33,4 @@ dicoParams = dict(nomCas            = 'fissTuyau',
     execInstance = casStandard(dicoParams)
     
     if salome.sg.hasDesktop():
    -    salome.sg.updateObjBrowser(True)
    +    salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/exemple2.py b/src/Tools/blocFissure/exemple2.py
    index 1b0141f65..be2ba7cbd 100644
    --- a/src/Tools/blocFissure/exemple2.py
    +++ b/src/Tools/blocFissure/exemple2.py
    @@ -4,10 +4,8 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
    -notebook = salome_notebook.NoteBook(theStudy)
     
     ###
     ### GEOM component
    @@ -18,8 +16,7 @@ from salome.geom import geomBuilder
     import math
     import SALOMEDS
     
    -
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -49,7 +46,7 @@ geompy.addToStudy( Cut_1, 'Cut_1' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     from salome.StdMeshers import StdMeshersBuilder
     boite = smesh.Mesh(Box_1)
     Regular_1D = boite.Segment()
    @@ -91,4 +88,4 @@ dicoParams = dict(nomCas            = 'angleCube2',
     execInstance = casStandard(dicoParams)
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/fissureLauncher.py b/src/Tools/blocFissure/fissureLauncher.py
    index f8b761fab..4638d9aeb 100644
    --- a/src/Tools/blocFissure/fissureLauncher.py
    +++ b/src/Tools/blocFissure/fissureLauncher.py
    @@ -33,4 +33,4 @@ dicoParams = dict(nomCas            = 'fissTuyau',
     execInstance = casStandard(dicoParams)
     
     if salome.sg.hasDesktop():
    -    salome.sg.updateObjBrowser(True)
    \ No newline at end of file
    +    salome.sg.updateObjBrowser()
    \ No newline at end of file
    diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py
    index 8db3cabb0..904e83a72 100644
    --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py
    +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py
    @@ -333,7 +333,7 @@ def construitFissureGenerale(maillagesSains,
       logging.info("fichier maillage fissure %s", fichierMaillageFissure)
     
       if salome.sg.hasDesktop():
    -    salome.sg.updateObjBrowser(True)
    +    salome.sg.updateObjBrowser()
     
       logging.info("maillage fissure fini")
       
    diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py
    index d4270fcea..d119ce0ac 100644
    --- a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py
    +++ b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py
    @@ -21,8 +21,6 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
       #TODO: a compléter
       """
       logging.info('start')
    -  
    -  #smesh.SetCurrentStudy(salome.myStudy)
     
       geometrieSaine      = geometriesSaines[0]
       maillageSain        = maillagesSains[0]
    diff --git a/src/Tools/blocFissure/gmu/geomsmesh.py b/src/Tools/blocFissure/gmu/geomsmesh.py
    index 4c61d1b92..15882b74c 100644
    --- a/src/Tools/blocFissure/gmu/geomsmesh.py
    +++ b/src/Tools/blocFissure/gmu/geomsmesh.py
    @@ -8,10 +8,10 @@ import salome
     salome.salome_init()
     
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     from salome.smesh import smeshBuilder
    -smesh = smeshBuilder.New(salome.myStudy)
    +smesh = smeshBuilder.New()
     
     # logging.debug("initialisation de geompy et smesh OK")
     
    diff --git a/src/Tools/blocFissure/gmu/insereFissureElliptique.py b/src/Tools/blocFissure/gmu/insereFissureElliptique.py
    index de8fbeb17..1b0b8abd3 100644
    --- a/src/Tools/blocFissure/gmu/insereFissureElliptique.py
    +++ b/src/Tools/blocFissure/gmu/insereFissureElliptique.py
    @@ -194,6 +194,6 @@ def insereFissureElliptique(geometriesSaines, maillagesSains,
       logging.info("fichier maillage fissure : %s", fichierMaillageFissure)
     
       if salome.sg.hasDesktop():
    -    salome.sg.updateObjBrowser(True)
    +    salome.sg.updateObjBrowser()
     
       return maillageComplet
    diff --git a/src/Tools/blocFissure/gmu/insereFissureGenerale.py b/src/Tools/blocFissure/gmu/insereFissureGenerale.py
    index a8619bdda..a475f7c65 100644
    --- a/src/Tools/blocFissure/gmu/insereFissureGenerale.py
    +++ b/src/Tools/blocFissure/gmu/insereFissureGenerale.py
    @@ -1378,7 +1378,7 @@ def insereFissureGenerale(maillagesSains,
       logging.info("fichier maillage fissure %s", fichierMaillageFissure)
     
       if salome.sg.hasDesktop():
    -    salome.sg.updateObjBrowser(True)
    +    salome.sg.updateObjBrowser()
     
       logging.info("maillage fissure fini")
       
    diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue.py b/src/Tools/blocFissure/gmu/insereFissureLongue.py
    index 347fb401c..02fa6b699 100644
    --- a/src/Tools/blocFissure/gmu/insereFissureLongue.py
    +++ b/src/Tools/blocFissure/gmu/insereFissureLongue.py
    @@ -654,6 +654,6 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
       logging.info("fichier maillage fissure %s", fichierMaillageFissure)
     
       if salome.sg.hasDesktop():
    -    salome.sg.updateObjBrowser(True)
    +    salome.sg.updateObjBrowser()
     
       return  maillageComplet
    \ No newline at end of file
    diff --git a/src/Tools/blocFissure/ihm/fissureCoude_plugin.py b/src/Tools/blocFissure/ihm/fissureCoude_plugin.py
    index 30936d50c..fa561d6f3 100644
    --- a/src/Tools/blocFissure/ihm/fissureCoude_plugin.py
    +++ b/src/Tools/blocFissure/ihm/fissureCoude_plugin.py
    @@ -27,9 +27,8 @@ import math
     from blocFissure import gmu
     
     def fissureCoudeDlg(context):
    -  # get context study, studyId, salomeGui
    +  # get context study, salomeGui
       study = context.study
    -  studyId = context.studyId
       sg = context.sg
       
       import os
    diff --git a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py
    index 48d962653..e7582a4f4 100644
    --- a/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py
    +++ b/src/Tools/blocFissure/ihm/fissureGenerale_plugin.py
    @@ -27,9 +27,8 @@ import math
     from blocFissure import gmu
     
     def fissureGeneraleDlg(context):
    -  # get context study, studyId, salomeGui
    +  # get context study, salomeGui
       study = context.study
    -  studyId = context.studyId
       sg = context.sg
     
       import os
    diff --git a/src/Tools/blocFissure/lanceurSoudureArrondieTest.py b/src/Tools/blocFissure/lanceurSoudureArrondieTest.py
    index 3b0097aa4..b24d86cf7 100644
    --- a/src/Tools/blocFissure/lanceurSoudureArrondieTest.py
    +++ b/src/Tools/blocFissure/lanceurSoudureArrondieTest.py
    @@ -29,4 +29,4 @@ dicoParams = dict(nomCas            = 'casTestCoinTriple',
     execInstance = casStandard(dicoParams)
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/lanceurSoudureViveTest.py b/src/Tools/blocFissure/lanceurSoudureViveTest.py
    index 89ceb14e7..4ffd10a8a 100644
    --- a/src/Tools/blocFissure/lanceurSoudureViveTest.py
    +++ b/src/Tools/blocFissure/lanceurSoudureViveTest.py
    @@ -29,4 +29,4 @@ dicoParams = dict(nomCas            = 'casTestCoinTriple',
     execInstance = casStandard(dicoParams)
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/lanceurTestAubry.py b/src/Tools/blocFissure/lanceurTestAubry.py
    index 49eeed3ae..d7789575e 100644
    --- a/src/Tools/blocFissure/lanceurTestAubry.py
    +++ b/src/Tools/blocFissure/lanceurTestAubry.py
    @@ -29,4 +29,4 @@ dicoParams = dict(nomCas            = 'testAubry',
     execInstance = casStandard(dicoParams)
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/cubeAngle.py b/src/Tools/blocFissure/materielCasTests/cubeAngle.py
    index a9c4769aa..9b4f4481c 100644
    --- a/src/Tools/blocFissure/materielCasTests/cubeAngle.py
    +++ b/src/Tools/blocFissure/materielCasTests/cubeAngle.py
    @@ -4,10 +4,8 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
    -notebook = salome_notebook.NoteBook(theStudy)
     
     import os
     from blocFissure import gmu
    @@ -22,7 +20,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -55,7 +53,7 @@ geompy.addToStudy( Common_1, 'Common_1' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     from salome.StdMeshers import StdMeshersBuilder
     Mesh_1 = smesh.Mesh(Box_1)
     Regular_1D = Mesh_1.Segment()
    @@ -75,4 +73,4 @@ smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
     smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/cubeFin.py b/src/Tools/blocFissure/materielCasTests/cubeFin.py
    index 3eeb130df..01feafa56 100644
    --- a/src/Tools/blocFissure/materielCasTests/cubeFin.py
    +++ b/src/Tools/blocFissure/materielCasTests/cubeFin.py
    @@ -4,10 +4,8 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
    -notebook = salome_notebook.NoteBook(theStudy)
     
     import os
     from blocFissure import gmu
    @@ -22,7 +20,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -104,7 +102,7 @@ geompy.ExportBREP(cubeFin_Milieu, os.path.join(gmu.pathBloc, "materielCasTests/c
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     cubeFin_1 = smesh.Mesh(cubeFin)
     Regular_1D = cubeFin_1.Segment()
     Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
    @@ -127,4 +125,4 @@ smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
     cubeFin_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/cubeFin.med"), 0, SMESH.MED_V2_2, 1 )
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/decoupeCylindre.py b/src/Tools/blocFissure/materielCasTests/decoupeCylindre.py
    index c43889c94..6fc419388 100644
    --- a/src/Tools/blocFissure/materielCasTests/decoupeCylindre.py
    +++ b/src/Tools/blocFissure/materielCasTests/decoupeCylindre.py
    @@ -22,7 +22,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -125,7 +125,7 @@ geompy.addToStudy( FissInCylindre2, 'FissInCylindre2' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     from salome.StdMeshers import StdMeshersBuilder
     smeshObj_1 = smesh.CreateHypothesis('NumberOfSegments')
     smeshObj_1.SetNumberOfSegments( 5 )
    @@ -164,4 +164,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
     smesh.SetName(SubMesh_2, 'SubMesh_2')
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/disque_perce.py b/src/Tools/blocFissure/materielCasTests/disque_perce.py
    index 7fc7173dc..43640c422 100644
    --- a/src/Tools/blocFissure/materielCasTests/disque_perce.py
    +++ b/src/Tools/blocFissure/materielCasTests/disque_perce.py
    @@ -4,7 +4,6 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
     notebook = salome_notebook.notebook
    @@ -23,7 +22,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -56,7 +55,7 @@ geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     from salome.StdMeshers import StdMeshersBuilder
     Disque_1 = smesh.Mesh(Disque)
     Regular_1D = Disque_1.Segment()
    @@ -86,4 +85,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
     smesh.SetName(SubMesh_2, 'SubMesh_2')
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/ellipse.py b/src/Tools/blocFissure/materielCasTests/ellipse.py
    index e55e913cf..8a57b3aa1 100644
    --- a/src/Tools/blocFissure/materielCasTests/ellipse.py
    +++ b/src/Tools/blocFissure/materielCasTests/ellipse.py
    @@ -4,7 +4,6 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
     notebook = salome_notebook.notebook
    @@ -22,7 +21,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -58,4 +57,4 @@ geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse
     
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/ellipse_disque.py b/src/Tools/blocFissure/materielCasTests/ellipse_disque.py
    index b0b1d37f3..56f2861a4 100644
    --- a/src/Tools/blocFissure/materielCasTests/ellipse_disque.py
    +++ b/src/Tools/blocFissure/materielCasTests/ellipse_disque.py
    @@ -4,10 +4,8 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
    -notebook = salome_notebook.NoteBook(theStudy)
     
     import os
     from blocFissure import gmu
    @@ -22,7 +20,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -50,4 +48,4 @@ geompy.addToStudy( Ellipse_disque, 'Ellipse_disque' )
     
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/ellipse_probleme.py b/src/Tools/blocFissure/materielCasTests/ellipse_probleme.py
    index 5b01a500d..b607f7c78 100644
    --- a/src/Tools/blocFissure/materielCasTests/ellipse_probleme.py
    +++ b/src/Tools/blocFissure/materielCasTests/ellipse_probleme.py
    @@ -4,7 +4,6 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
     notebook = salome_notebook.notebook
    @@ -22,7 +21,7 @@ from salome.geom import geomBuilder
     import math
     import SALOMEDS
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     Disk_1 = geompy.MakeDiskR(100, 1)
     O = geompy.MakeVertex(0, 0, 0)
    @@ -56,4 +55,4 @@ geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests/ellipse
     
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py b/src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py
    index 343070352..40cb7c8d5 100644
    --- a/src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py
    +++ b/src/Tools/blocFissure/materielCasTests/eprouvetteCourbe.py
    @@ -4,7 +4,6 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
     notebook = salome_notebook.notebook
    @@ -22,7 +21,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -72,7 +71,7 @@ geompy.addToStudyInFather( EprouvetteCourbe, Compound_x, 'Compound_x' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     from salome.StdMeshers import StdMeshersBuilder
     EprouvetteCourbe_1 = smesh.Mesh(EprouvetteCourbe)
     Regular_1D = EprouvetteCourbe_1.Segment()
    @@ -104,4 +103,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
     smesh.SetName(SubMesh_2, 'SubMesh_2')
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py b/src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py
    index 1b2ef1c47..2f6bcff20 100644
    --- a/src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py
    +++ b/src/Tools/blocFissure/materielCasTests/eprouvetteDroite.py
    @@ -4,10 +4,8 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
    -notebook = salome_notebook.NoteBook(theStudy)
     
     import os
     from blocFissure import gmu
    @@ -22,7 +20,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -107,7 +105,7 @@ geompy.addToStudy( Face_2, 'Face_2' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     from salome.StdMeshers import StdMeshersBuilder
     eprouvetteDroite_1 = smesh.Mesh(eprouvetteDroite)
     Regular_1D = eprouvetteDroite_1.Segment()
    @@ -139,4 +137,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
     smesh.SetName(SubMesh_2, 'SubMesh_2')
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche.py b/src/Tools/blocFissure/materielCasTests/fissureGauche.py
    index a6d4e3999..18796848d 100644
    --- a/src/Tools/blocFissure/materielCasTests/fissureGauche.py
    +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche.py
    @@ -4,7 +4,6 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
     notebook = salome_notebook.notebook
    @@ -22,7 +21,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -101,7 +100,7 @@ geompy.addToStudyInFather( objetSain, Compound_6, 'Compound_6' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     from salome.StdMeshers import StdMeshersBuilder
     objetSain_1 = smesh.Mesh(objetSain)
     Regular_1D = objetSain_1.Segment()
    @@ -133,4 +132,4 @@ smesh.SetName(SubMesh_1, 'SubMesh_1')
     smesh.SetName(SubMesh_2, 'SubMesh_2')
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py
    index 0f08fd715..c2fcbb0c4 100644
    --- a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py
    +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py
    @@ -4,7 +4,6 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
     notebook = salome_notebook.notebook
    @@ -22,7 +21,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
    @@ -75,7 +74,7 @@ geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     from salome.StdMeshers import StdMeshersBuilder
     Mesh_1 = smesh.Mesh(objetSain)
     Regular_1D = Mesh_1.Segment()
    @@ -95,4 +94,4 @@ smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
     smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/blocFissure/materielCasTests/vis.py b/src/Tools/blocFissure/materielCasTests/vis.py
    index ce9aa6805..67983ac1b 100644
    --- a/src/Tools/blocFissure/materielCasTests/vis.py
    +++ b/src/Tools/blocFissure/materielCasTests/vis.py
    @@ -4,7 +4,6 @@ import sys
     import salome
     
     salome.salome_init()
    -theStudy = salome.myStudy
     
     import salome_notebook
     notebook = salome_notebook.notebook
    @@ -22,7 +21,7 @@ import math
     import SALOMEDS
     
     
    -geompy = geomBuilder.New(theStudy)
    +geompy = geomBuilder.New()
     O = geompy.MakeVertex(0, 0, 0)
     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
     OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
    @@ -167,7 +166,7 @@ geompy.addToStudyInFather( Fissure, fondFiss, 'fondFiss' )
     import  SMESH, SALOMEDS
     from salome.smesh import smeshBuilder
     
    -smesh = smeshBuilder.New(theStudy)
    +smesh = smeshBuilder.New()
     coupe_vis_1 = smesh.Mesh(coupe_vis)
     Regular_1D = coupe_vis_1.Segment()
     Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
    @@ -245,4 +244,4 @@ smesh.SetName(tige_haute_2, 'tige_haute')
     
     
     if salome.sg.hasDesktop():
    -  salome.sg.updateObjBrowser(True)
    +  salome.sg.updateObjBrowser()
    diff --git a/src/Tools/padder/meshjob/idl/SPADDERPluginTest.idl b/src/Tools/padder/meshjob/idl/SPADDERPluginTest.idl
    index a0b78faaa..f84c83b4b 100644
    --- a/src/Tools/padder/meshjob/idl/SPADDERPluginTest.idl
    +++ b/src/Tools/padder/meshjob/idl/SPADDERPluginTest.idl
    @@ -40,7 +40,7 @@ module SPADDERPluginTest {
       {
         void demo(in double a,in double b,out double c) raises (SALOME::SALOME_Exception);
         boolean testkernel() raises (SALOME::SALOME_Exception);
    -    boolean testsmesh(in long studyId) raises (SALOME::SALOME_Exception);
    +    boolean testsmesh() raises (SALOME::SALOME_Exception);
       };
     };
     
    diff --git a/src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.cxx b/src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.cxx
    index 10b5b94c8..220f73727 100644
    --- a/src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.cxx
    +++ b/src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.cxx
    @@ -118,16 +118,15 @@ bool SPADDERPluginTester_i::testkernel()
      * This test checks the constructor of the basic classes of the SMESH
      * plugin for PADDER.
      */
    -bool SPADDERPluginTester_i::testsmesh(CORBA::Long studyId)
    +bool SPADDERPluginTester_i::testsmesh()
     {
       beginService("SPADDERPluginTester_i::testsmesh");
     
       // Resolve the SMESH engine and the SALOME study
       // _WARN_ The SMESH engine should have been loaded first
       SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
    -  CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
    -  SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
    -  SALOMEDS::Study_var myStudy = aStudyMgr->GetStudyByID(studyId);
    +  CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/Study");
    +  SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(anObject);
     
       //
       // _MEM_ CAUTION: SMESH_Gen define a data structure for local usage
    diff --git a/src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.hxx b/src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.hxx
    index 9a2193d55..c6eea5ec4 100644
    --- a/src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.hxx
    +++ b/src/Tools/padder/meshjob/impl/SPADDERPluginTester_i.hxx
    @@ -50,7 +50,7 @@ public:
       
       void demo(CORBA::Double a,CORBA::Double b,CORBA::Double& c);
       bool testkernel();
    -  bool testsmesh(CORBA::Long studyId);
    +  bool testsmesh();
     
     };
     
    diff --git a/src/Tools/padder/resources/testdata/buildparticules.py b/src/Tools/padder/resources/testdata/buildparticules.py
    index b279695da..d4ce4adaa 100755
    --- a/src/Tools/padder/resources/testdata/buildparticules.py
    +++ b/src/Tools/padder/resources/testdata/buildparticules.py
    @@ -22,7 +22,7 @@ import salome
     salome.salome_init()
     import GEOM
     from salome.geom import geomBuilder
    -geompy = geomBuilder.New(salome.myStudy)
    +geompy = geomBuilder.New()
     
     filename="/home/gboulant/development/projets/salome/SPADDER/spadder/resources/padderexe/REF_spheres.dat.xyz"
     file=open(filename,'rb')
    diff --git a/src/Tools/padder/spadderpy/gui/inputdialog.py b/src/Tools/padder/spadderpy/gui/inputdialog.py
    index 2ca9f8fc9..6824a9448 100644
    --- a/src/Tools/padder/spadderpy/gui/inputdialog.py
    +++ b/src/Tools/padder/spadderpy/gui/inputdialog.py
    @@ -178,7 +178,7 @@ class InputDialog(GenericDialog):
                 self.__selectedMesh = None
                 return
     
    -        self.smeshStudyTool.updateStudy(studyedit.getActiveStudyId())
    +        self.smeshStudyTool.updateStudy()
             self.__selectedMesh = self.smeshStudyTool.getMeshObjectFromSObject(mySObject)
             if CORBA.is_nil(self.__selectedMesh):
                 self.__ui.txtSmeshObject.setText("The selected object is not a mesh")
    diff --git a/src/Tools/padder/spadderpy/gui/plugindialog.py b/src/Tools/padder/spadderpy/gui/plugindialog.py
    index 4fec4e8d3..fff90b9fb 100644
    --- a/src/Tools/padder/spadderpy/gui/plugindialog.py
    +++ b/src/Tools/padder/spadderpy/gui/plugindialog.py
    @@ -38,7 +38,7 @@ from salome.kernel.uiexception import AdminException
     from omniORB import CORBA
     import SMESH
     from salome.smesh import smeshBuilder
    -smesh = smeshBuilder.New(salome.myStudy)
    +smesh = smeshBuilder.New()
     import MESHJOB
     
     gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"]
    @@ -368,7 +368,7 @@ class PluginDialog(QDialog):
             medfilename = os.path.join(meshJobResults.results_dirname,
                                        meshJobResults.outputmesh_filename)
     
    -        smesh.SetCurrentStudy(studyedit.getActiveStudy())
    +        smesh.UpdateStudy()
             ([outputMesh], status) = smesh.CreateMeshesFromMED(medfilename)
     
             # By convention, the name of the output mesh in the study is
    @@ -376,7 +376,7 @@ class PluginDialog(QDialog):
             meshname = 'padder_'+str(self.__jobid)
             smesh.SetName(outputMesh.GetMesh(), meshname)
             if salome.sg.hasDesktop():
    -            salome.sg.updateObjBrowser(False)
    +            salome.sg.updateObjBrowser()
     
             self.__ui.lblStatusBar.setText("Publication OK")
             self.__setGuiState(["CAN_SELECT"])
    diff --git a/src/Tools/padder/unittests/usecase_spadderPluginTester.py b/src/Tools/padder/unittests/usecase_spadderPluginTester.py
    index 65566eb4e..511c5d1f5 100644
    --- a/src/Tools/padder/unittests/usecase_spadderPluginTester.py
    +++ b/src/Tools/padder/unittests/usecase_spadderPluginTester.py
    @@ -47,6 +47,6 @@ c.testkernel()
     print "Test of usage of SMESH engine from the test component"
     import SMESH
     salome.lcc.FindOrLoadComponent("FactoryServer","SMESH")
    -c.testsmesh(salome.myStudyId)
    +c.testsmesh()
     
     print "Test completed : OK"