X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fcreating_meshes_ex07.py;h=669c9b088b3f0c847566f8f8e43c5bff94f8ffb4;hb=f5e84513cda0eda53672cc9d3b1124323b4aa26d;hp=3b003961eeda009be9b6eb9196ac29871c25c56d;hpb=bb40f7c1d3542da1ff59b6c3bface0574789dded;p=modules%2Fsmesh.git diff --git a/doc/salome/examples/creating_meshes_ex07.py b/doc/salome/examples/creating_meshes_ex07.py index 3b003961e..669c9b088 100644 --- a/doc/salome/examples/creating_meshes_ex07.py +++ b/doc/salome/examples/creating_meshes_ex07.py @@ -2,13 +2,10 @@ 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.) @@ -39,7 +36,7 @@ geompy.addToStudy(Box_sup, "Box_sup") 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") @@ -69,13 +66,20 @@ Ginf2=Mesh_sup.Group(Finf2, "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(1) + salome.sg.updateObjBrowser()