Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
e3d748df86 | |||
108e8e7ea0 | |||
b97bf83942 | |||
011d515a6a | |||
41a0e4da6a | |||
f455ddb314 | |||
5ed5109355 |
@ -1,7 +1,7 @@
|
|||||||
layers_content_toolbox
|
layers_content_toolbox
|
||||||
======================
|
======================
|
||||||
|
|
||||||
Package for (KLayout)[https://www.klayout.de] adding two items to the right-click menu in the "Layers" pane:
|
Package for [KLayout](https://www.klayout.de) adding two items to the right-click menu in the "Layers" pane:
|
||||||
|
|
||||||
- `Make All Valid`: Makes all layers valid (interactable) and visible. Adds hotkey Ctrl+Shift+V.
|
- `Make All Valid`: Makes all layers valid (interactable) and visible. Adds hotkey Ctrl+Shift+V.
|
||||||
- `Change Layer for Objects`: Same as `Edit -> Selection -> Change Layer`
|
- `Change Layer for Objects`: Same as `Edit -> Selection -> Change Layer`
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 63 KiB |
@ -3,7 +3,7 @@
|
|||||||
<name>layers_context_toolbox</name>
|
<name>layers_context_toolbox</name>
|
||||||
<token/>
|
<token/>
|
||||||
<hidden>false</hidden>
|
<hidden>false</hidden>
|
||||||
<version>1.0</version>
|
<version>1.2</version>
|
||||||
<api-version/>
|
<api-version/>
|
||||||
<title>Layers context toolbox</title>
|
<title>Layers context toolbox</title>
|
||||||
<doc>Adds items to the "Layers" pane context menu: "Change Layer of Objects", "Make All Valid"</doc>
|
<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>Jan Petykiewicz</author>
|
||||||
<author-contact>jan@mpxd.net</author-contact>
|
<author-contact>jan@mpxd.net</author-contact>
|
||||||
<authored-time/>
|
<authored-time/>
|
||||||
<installed-time>2025-04-10T16:58:24</installed-time>
|
<installed-time>2025-04-10T20:14:31</installed-time>
|
||||||
<icon/>
|
<icon/>
|
||||||
<screenshot/>
|
<screenshot/>
|
||||||
</salt-grain>
|
</salt-grain>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<klayout-macro>
|
<klayout-macro>
|
||||||
<description>add "Change Layer of Selection" to layer context menu</description>
|
<description>add "Change Layer of Objects" to layer context menu</description>
|
||||||
<version/>
|
<version/>
|
||||||
<category>pymacros</category>
|
<category>pymacros</category>
|
||||||
<prolog/>
|
<prolog/>
|
||||||
@ -33,5 +33,6 @@ new_action.title = 'Change Layer of Objects'
|
|||||||
new_action.on_triggered = change_layer_action.trigger
|
new_action.on_triggered = change_layer_action.trigger
|
||||||
|
|
||||||
menu.insert_separator('@lcp_context_menu.end', 'tb_separator')
|
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>
|
</klayout-macro>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<klayout-macro>
|
<klayout-macro>
|
||||||
<description>add "Set All Valid" to layer context menu</description>
|
<description>add "Make All Valid" to layer context menu</description>
|
||||||
<version/>
|
<version/>
|
||||||
<category>pymacros</category>
|
<category>pymacros</category>
|
||||||
<prolog/>
|
<prolog/>
|
||||||
@ -9,19 +9,19 @@
|
|||||||
<autorun>true</autorun>
|
<autorun>true</autorun>
|
||||||
<autorun-early>false</autorun-early>
|
<autorun-early>false</autorun-early>
|
||||||
<priority>3</priority>
|
<priority>3</priority>
|
||||||
<shortcut>Ctrl+Shift+V</shortcut>
|
<shortcut/>
|
||||||
<show-in-menu>false</show-in-menu>
|
<show-in-menu>false</show-in-menu>
|
||||||
<group-name/>
|
<group-name/>
|
||||||
<menu-path>@lcp_context_menu.end</menu-path>
|
<menu-path>@lcp_context_menu.end</menu-path>
|
||||||
<interpreter>python</interpreter>
|
<interpreter>python</interpreter>
|
||||||
<dsl-interpreter-name/>
|
<dsl-interpreter-name/>
|
||||||
<text>"""
|
<text>"""
|
||||||
Add "Change Layer of Objects" to Layer context menu
|
Add "Make All Valid" to Layer context menu
|
||||||
"""
|
"""
|
||||||
import pya
|
import pya
|
||||||
|
|
||||||
|
|
||||||
def set_all_valid():
|
def make_all_valid():
|
||||||
view = pya.LayoutView.current()
|
view = pya.LayoutView.current()
|
||||||
for layer in view.each_layer():
|
for layer in view.each_layer():
|
||||||
layer.valid = True
|
layer.valid = True
|
||||||
@ -31,8 +31,10 @@ mw = pya.Application.instance().main_window()
|
|||||||
menu = mw.menu()
|
menu = mw.menu()
|
||||||
|
|
||||||
new_action = pya.Action()
|
new_action = pya.Action()
|
||||||
new_action.title = 'Set All Valid'
|
new_action.title = 'Make All Valid'
|
||||||
new_action.on_triggered = set_all_valid
|
new_action.on_triggered = make_all_valid
|
||||||
|
new_action.default_shortcut = 'Ctrl+Shift+V'
|
||||||
|
|
||||||
menu.insert_item('@lcp_context_menu.invvalid', 'change_layer', new_action)</text>
|
menu.insert_item('@lcp_context_menu.rename', 'make_all_valid', new_action)
|
||||||
|
</text>
|
||||||
</klayout-macro>
|
</klayout-macro>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user