Salome HOME
Copyright update 2022
[modules/smesh.git] / src / SMESH_SWIG / ex24_cylinder.py
index 0ab9ddaec0bff8431195dcba31d8175e5f785e8e..2946be21f918b4b226aa10e8da70de32d2187dab 100644 (file)
@@ -1,10 +1,10 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -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)
@@ -130,3 +130,8 @@ hexa.Compute()
 hexa.Group(group_a)
 hexa.Group(group_b)
 hexa.Group(group_1)
+
+# Update object browser
+# ---------------------
+
+salome.sg.updateObjBrowser()