add "Change Layer of Objects" to layer context menu
pymacros
true
false
5
false
@lcp_context_menu.end
python
"""
Add "Change Layer of Objects" to Layer context menu
Roughly follows method from https://www.klayout.de/forum/discussion/192/fill-klayout-dialogs-from-rba
"""
import pya
mw = pya.Application.instance().main_window()
menu = mw.menu()
change_layer_action = menu.action('edit_menu.selection_menu.change_layer')
change_layer_action.trigger
new_action = pya.Action()
new_action.title = 'Change Layer of Objects'
new_action.on_triggered = change_layer_action.trigger
menu.insert_separator('@lcp_context_menu.end', 'tb_separator')
menu.insert_item('@lcp_context_menu.end', 'change_layer', new_action)