Salome HOME
Update copyrights
[modules/smesh.git] / src / SMESH_SWIG / ex30_tepal.py
index 661654efc9d037b926cd7cc54211cb7de8734b87..5866ceb373e48f67f747cf37b32fc6e7e66b25f8 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2019  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
@@ -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)
 
@@ -76,7 +76,6 @@ algo3d.SetMEDName(results)
 algo3d.SetNbPart(4)
 algo3d.SetBackground(False)
 algo3d.SetKeepFiles(False)
-algo3d.SetToMeshHoles(True)
 
 # Launch meshers
 # --------------
@@ -87,6 +86,11 @@ status = m.Compute()
 # ----------
 
 if os.access(results+".xml", os.F_OK):
-    print "Ok: tepal"
+    print("Ok: tepal")
 else:
-    print "KO: tepal"
+    print("KO: tepal")
+
+# Update object browser
+# ---------------------
+
+salome.sg.updateObjBrowser()