41 lines
991 B
XML
41 lines
991 B
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<klayout-macro>
|
|
<description>add "Make All Valid" to layer context menu</description>
|
|
<version/>
|
|
<category>pymacros</category>
|
|
<prolog/>
|
|
<epilog/>
|
|
<doc/>
|
|
<autorun>true</autorun>
|
|
<autorun-early>false</autorun-early>
|
|
<priority>3</priority>
|
|
<shortcut/>
|
|
<show-in-menu>false</show-in-menu>
|
|
<group-name/>
|
|
<menu-path>@lcp_context_menu.end</menu-path>
|
|
<interpreter>python</interpreter>
|
|
<dsl-interpreter-name/>
|
|
<text>"""
|
|
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)
|
|
</text>
|
|
</klayout-macro>
|