X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fquality_controls_ex21.py;h=683e314b74ea305812536aaf2088ce274cac8a25;hb=9e3db5ed1d2fc44ca6560ae3fd5570b7bca6323f;hp=833ffff815e9f04901633b6ce61a69d3e885e6a3;hpb=9a54694a0ab1e5cbc558a35c4606ceea4f7af2ef;p=modules%2Fsmesh.git diff --git a/doc/salome/examples/quality_controls_ex21.py b/doc/salome/examples/quality_controls_ex21.py index 833ffff81..683e314b7 100644 --- a/doc/salome/examples/quality_controls_ex21.py +++ b/doc/salome/examples/quality_controls_ex21.py @@ -1,6 +1,7 @@ # Volume import SMESH_mechanic_tetra +import SMESH smesh = SMESH_mechanic_tetra.smesh mesh = SMESH_mechanic_tetra.mesh @@ -9,24 +10,24 @@ salome = SMESH_mechanic_tetra.salome # Criterion : VOLUME < 7. volume_margin = 7. -aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin) +aFilter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_Volume3D, SMESH.FT_LessThan, volume_margin) anIds = mesh.GetIdsFromFilter(aFilter) # print the result -print "" -print "Criterion: Volume < ", volume_margin, " Nb = ", len(anIds) +print("") +print("Criterion: Volume < ", volume_margin, " Nb = ", len(anIds)) j = 1 for i in range(len(anIds)): - if j > 20: j = 1; print "" - print anIds[i], + if j > 20: j = 1; print("") + print(anIds[i], end=' ') j = j + 1 pass -print "" +print("") # create a group -aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Volume < " + `volume_margin`) +aGroup = mesh.CreateEmptyGroup(SMESH.VOLUME, "Volume < " + repr(volume_margin)) aGroup.Add(anIds) -salome.sg.updateObjBrowser(1) +salome.sg.updateObjBrowser()