From 352e0ac1fff50a9970a8ad51f1eca3fb79d24aef Mon Sep 17 00:00:00 2001 From: gdd Date: Thu, 15 Dec 2011 17:01:55 +0000 Subject: [PATCH] rnc: EDF 2050 -> documentation added to explain the way to work with objects fecthed from GUI in the Python console --- .../gui/SMESH/input/smeshpy_interface.doc | 3 ++- .../input/tui_work_on_objects_from_gui.doc | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc diff --git a/doc/salome/gui/SMESH/input/smeshpy_interface.doc b/doc/salome/gui/SMESH/input/smeshpy_interface.doc index 84663c93d..6669892c0 100644 --- a/doc/salome/gui/SMESH/input/smeshpy_interface.doc +++ b/doc/salome/gui/SMESH/input/smeshpy_interface.doc @@ -140,6 +140,7 @@ the following links: - \subpage tui_transforming_meshes_page - \subpage tui_notebook_smesh_page - \subpage tui_measurements_page -- \subpage tui_generate_flat_elements_page +- \subpage tui_generate_flat_elements_page +- \subpage tui_work_on_objects_from_gui */ diff --git a/doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc b/doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc new file mode 100644 index 000000000..96927eeb7 --- /dev/null +++ b/doc/salome/gui/SMESH/input/tui_work_on_objects_from_gui.doc @@ -0,0 +1,27 @@ +/*! + +\page tui_work_on_objects_from_gui How to work with objects from the GUI ? + +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: + +\code +myMesh_ref = salome.IdToObject("ID") +// were ID is the number that appears in the object browser in the Entry column +// ( If hidden show it by right clicking and checking the checknbox Entry) +myMesh = smesh.Mesh(myMesh_ref) +\endcode +or +\code +myMesh_ref = salome.myStudy.FindObjectByPath("/Mesh/myMesh").GetObject() +// "/Mesh/myMesh" is the path to the desired object in the object browser +myMesh = smesh.Mesh(myMesh_ref) +\endcode + +All the methods documented in these pages can then be used on myMesh + +\note The first statement only gives you access to a reference to the object created via the GUI. +\n But the methods available on this reference are not exactly the same as those documented in these help pages. +This Python API is meant to be used on smesh.Mesh instances. +\n That's why you'll have to create such an instance with the second statement. + +*/ \ No newline at end of file -- 2.39.2