3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
insert_in_menu.py

Insert the command into the menu.

Insert the command into the menu

1# The simplest program - just show the Hello world!
2import coat
3# add the translation of the identifier "test_script"
4coat.ui.addTranslation("test_script", "The example command")
5# if the command is not inserted in the file menu, we insert it there
6if not coat.ui.checkIfMenuItemInserted("test_script"):
7 coat.ui.insertInMenu("File","test_script","")
8 coat.dialog().text("The 'test_script' inserted into the File menu.").ok().show()
9else:
10 # ... if inserted, we execute the action
11 coat.dialog().text("Hello world!").ok().show()
Definition coat.py:3433
addTranslation(id=str, text=str)
Add the translation for the text identifier.
Definition coat.py:3352
insertInMenu(Menu=str, ID_in_menu=str, script_path=str)
Insert the scripted command into the main menu.
Definition coat.py:3313
bool checkIfMenuItemInserted(ID_in_menu=str)
Check if the command inserted somewhere into the menu.
Definition coat.py:3334