Compare commits
No commits in common. "b97bf83942c089ae568b83af1285321f1df8529f" and "5ed510935580084f63d4cadd629b0cb81061706d" have entirely different histories.
b97bf83942
...
5ed5109355
Binary file not shown.
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 64 KiB |
@ -3,7 +3,7 @@
|
||||
<name>layers_context_toolbox</name>
|
||||
<token/>
|
||||
<hidden>false</hidden>
|
||||
<version>1.1</version>
|
||||
<version>1.0</version>
|
||||
<api-version/>
|
||||
<title>Layers context toolbox</title>
|
||||
<doc>Adds items to the "Layers" pane context menu: "Change Layer of Objects", "Make All Valid"</doc>
|
||||
@ -13,7 +13,7 @@
|
||||
<author>Jan Petykiewicz</author>
|
||||
<author-contact>jan@mpxd.net</author-contact>
|
||||
<authored-time/>
|
||||
<installed-time>2025-04-10T20:14:31</installed-time>
|
||||
<installed-time>2025-04-10T16:58:24</installed-time>
|
||||
<icon/>
|
||||
<screenshot/>
|
||||
</salt-grain>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<klayout-macro>
|
||||
<description>add "Change Layer of Objects" to layer context menu</description>
|
||||
<description>add "Change Layer of Selection" to layer context menu</description>
|
||||
<version/>
|
||||
<category>pymacros</category>
|
||||
<prolog/>
|
||||
@ -33,6 +33,5 @@ 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)
|
||||
</text>
|
||||
menu.insert_item('@lcp_context_menu.end', 'change_layer', new_action)</text>
|
||||
</klayout-macro>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<klayout-macro>
|
||||
<description>add "Make All Valid" to layer context menu</description>
|
||||
<description>add "Set All Valid" to layer context menu</description>
|
||||
<version/>
|
||||
<category>pymacros</category>
|
||||
<prolog/>
|
||||
@ -16,12 +16,12 @@
|
||||
<interpreter>python</interpreter>
|
||||
<dsl-interpreter-name/>
|
||||
<text>"""
|
||||
Add "Make All Valid" to Layer context menu
|
||||
Add "Change Layer of Objects" to Layer context menu
|
||||
"""
|
||||
import pya
|
||||
|
||||
|
||||
def make_all_valid():
|
||||
def set_all_valid():
|
||||
view = pya.LayoutView.current()
|
||||
for layer in view.each_layer():
|
||||
layer.valid = True
|
||||
@ -31,9 +31,8 @@ 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.title = 'Set All Valid'
|
||||
new_action.on_triggered = set_all_valid
|
||||
|
||||
menu.insert_item('@lcp_context_menu.rename', 'make_all_valid', new_action)
|
||||
</text>
|
||||
menu.insert_item('@lcp_context_menu.invvalid', 'change_layer', new_action)</text>
|
||||
</klayout-macro>
|
||||
|
Loading…
x
Reference in New Issue
Block a user