2 .. _tui_work_on_objects_from_gui:
4 ***************************************
5 How to work with objects from the GUI ?
6 ***************************************
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::
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)
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)
24 from salome.gui import helper
25 myMesh_ref = helper.getSObjectSelected()[0].GetObject()
26 myMesh = smesh.Mesh(myMesh_ref)
28 A result myMesh is an object of :class:`Mesh <smeshBuilder.Mesh>` class.
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.