Salome HOME
Merge remote-tracking branch 'origin/master'
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_work_on_objects_from_gui.doc
1 /*!
2
3 \page tui_work_on_objects_from_gui How to work with objects from the GUI ?
4
5 It is sometimes useful to work alternatively in the GUI of SALOME and in the Python Console. To fetch an object from the TUI simply type:
6
7 \code{.py}
8 myMesh_ref = salome.IDToObject( ID )
9 # were ID is a string looking like "0:1:2:3" that appears in the Object Browser in the Entry column.
10 # ( If hidden, show it by right clicking and checking the checkbox Entry )
11 myMesh = smesh.Mesh(myMesh_ref)
12 \endcode
13 or 
14 \code{.py}
15 myMesh_ref = salome.myStudy.FindObjectByPath("/Mesh/myMesh").GetObject() 
16 #'/Mesh/myMesh' is a path to the desired object in the Object Browser
17 myMesh = smesh.Mesh(myMesh_ref)
18 \endcode
19 or 
20 \code{.py}
21 # get a selected mesh
22 from salome.gui import helper
23 myMesh_ref = helper.getSObjectSelected()[0].GetObject() 
24 myMesh = smesh.Mesh(myMesh_ref)
25 \endcode
26
27 All the methods documented in these pages can then be used on myMesh
28
29 \note The first statement only gives you access to a reference to the object created via the GUI. 
30 \n But the methods available on this reference are not exactly the same as those documented in these help pages. 
31 This Python API is meant to be used on smesh.Mesh instances. 
32 \n That's why you'll have to create such an instance with the second statement. 
33
34 */