add "Make All Valid" to layer context menu
pymacros
true
false
3
false
@lcp_context_menu.end
python
"""
Add "Make All Valid" to Layer context menu
"""
import pya
def make_all_valid():
view = pya.LayoutView.current()
for layer in view.each_layer():
layer.valid = True
layer.visible = True
mw = pya.Application.instance().main_window()
menu = mw.menu()
new_action = pya.Action()
new_action.title = 'Make All Valid'
new_action.on_triggered = make_all_valid
new_action.default_shortcut = 'Ctrl+Shift+V'
menu.insert_item('@lcp_context_menu.rename', 'make_all_valid', new_action)