Custom Plugin Question
Custom Plugin QuestionPosted by Jaume P at August 28. 2012
Dear Forum readers,
I would like to create some plugins to attach them to Salome GUI, I have read some post related with this matter and also spent a few hours going trhough the tutorials, unfortunately, I haven´t been able to succed yet.
This is one of the tutorials that I followed word by word: http://docs.salome-platform.org/salome_6_4_0/gui/GUI/using_pluginsmanager.html
I defined two system variables that point to the folder were the plugins are stored (SALOME_PLUGIN_PATH and another one)
My problem is that I can not achive to add new options to the menu bar that are already writen in the salome gui. May be is a problem with the version, the version in the example is 6.4 and I am running 6.5.
I have attached some Py files that I have been using in my attempts to create new menu options or new windows.
In these files i would like to draw special attention to MinMax_dialog.py that tries to generate a new window, but it does nothing at the end; and also to tubedialog.py and tubedialog_ui.py which in fact generate new windows, but they are useless and Salome hangs when this scripts are runned.
Best Regards. any help is much appreciated.
Re: Custom Plugin QuestionPosted by Jaume P at August 28. 2012
Sorry, I forgot to say that I am working in Win Vista 32bit and I use Salome 6.5.0 version, (I took the smallest package in the download page, the one that is already made)
Re: Custom Plugin QuestionPosted by Chrys Lides at September 04. 2012
You have to define your plugin in salome_plugins.py.
You can create a new salome_plugins.py file located in your ~/.config/salome/Plugins directory.
Try to add these lines to register your function:
salome_pluginsmanager.AddFunction('Min/max mesh controls',
'Displays the min/max value of a control',
You can have a look at the bride plugin in Salome-Meca. You can download the sources here (instead of downloading the full Salome-Meca package): http://lides.fr/pub/plugin_cabri.tgz