Salome HOME
Merge remote branch 'origin/V8_5_asterstudy'
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_work_on_objects_from_gui.rst
1
2 .. _tui_work_on_objects_from_gui: 
3
4 ***************************************
5 How to work with objects from the GUI ?
6 ***************************************
7
8 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::
9
10   myMesh_ref = salome.IDToObject( ID )
11   # were ID is a string looking like "0:1:2:3" that appears in the Object Browser in the Entry column.
12   # ( If hidden, show it by right clicking and checking the checkbox Entry )
13   myMesh = smesh.Mesh(myMesh_ref)
14
15 or:: 
16
17   myMesh_ref = salome.myStudy.FindObjectByPath("/Mesh/myMesh").GetObject() 
18   #'/Mesh/myMesh' is a path to the desired object in the Object Browser
19   myMesh = smesh.Mesh(myMesh_ref)
20
21 or::
22
23   # get a selected mesh
24   from salome.gui import helper
25   myMesh_ref = helper.getSObjectSelected()[0].GetObject() 
26   myMesh = smesh.Mesh(myMesh_ref)
27
28 A result myMesh is an object of :class:`Mesh <smeshBuilder.Mesh>` class.
29
30 .. note:: The first statement only gives you access to a reference to the object created via the GUI (`myMesh_ref`). But the methods available on this reference differ from those of :class:`Mesh <smeshBuilder.Mesh>` class documented in these help pages. That's why you have to create an instance of :class:`Mesh <smeshBuilder.Mesh>` class with the last statement.