1 # Create a Group on Geometry
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh = smeshBuilder.New()
15 box = geompy.MakeBox(0., 0., 0., 100., 100., 100.)
16 geompy.addToStudy(box, "box")
18 # add the first face of the box to the study
19 subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
20 face = subShapeList[0]
21 geompy.addToStudyInFather(box, face, "face 1")
23 # create group of edges on the face
24 aGeomGroupE = geompy.CreateGroup(face, geompy.ShapeType["EDGE"])
25 geompy.AddObject(aGeomGroupE, 3)
26 geompy.AddObject(aGeomGroupE, 6)
27 geompy.AddObject(aGeomGroupE, 8)
28 geompy.AddObject(aGeomGroupE, 10)
29 geompy.addToStudyInFather(face, aGeomGroupE, "Group of Edges")
31 # create quadrangle 2D mesh on the box
32 quadra = smesh.Mesh(box, "Box : quadrangle 2D mesh")
33 algo1D = quadra.Segment()
35 algo1D.NumberOfSegments(7)
40 # create SMESH group on the face with name "SMESHGroup1"
41 aSmeshGroup1 = quadra.GroupOnGeom(face, "SMESHGroup1")
43 # create SMESH group on <aGeomGroupE> with default name
44 aSmeshGroup2 = quadra.GroupOnGeom(aGeomGroupE)
46 salome.sg.updateObjBrowser()