import salome
salome.salome_init()
-import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
-
-import SMESH, SALOMEDS
+geompy = geomBuilder.New()
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.)
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")
## create compounds
# create a compound of two meshes with renaming namesake groups and
-# merging of elements with the given tolerance
+# merging elements with the given tolerance
Compound1 = smesh.Concatenate([Mesh_inf, Mesh_sup], 0, 1, 1e-05,
- name='Compound_with_RenamedGrps_and_MergeElems')
+ name='Compound with RenamedGrps and MergeElems')
# create a compound of two meshes with uniting namesake groups and
# creating groups of all elements
Compound2 = smesh.Concatenate([Mesh_inf, Mesh_sup], 1, 0, 1e-05, True,
- name='Compound_with_UniteGrps_and_GrpsOfAllElems')
+ name='Compound with UniteGrps and GrpsOfAllElems')
+
+# copy Gsup1 into a separate mesh and translate it
+groupMesh = Mesh_inf.TranslateObjectMakeMesh( Gsup1, [300,0,0] )
+
+# add Ginf2 to groupMesh
+smesh.Concatenate([Ginf2], False, meshToAppendTo = groupMesh )
+
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()