简体   繁体   English

Kicad6 插件未出现在菜单中

[英]Kicad6 Plug-in does not appear in menu

I am not able to get an action plug-in to appear in the PCBNEW menu.我无法让动作插件出现在 PCBNEW 菜单中。 I have run the following to determine the path:我已经运行以下命令来确定路径:

import pcbnew
print(pcbnew.PLUGIN_DIRECTORIES_SEARCH)

# with the following output:
/usr/share/kicad/scripting
/usr/share/kicad/scripting/plugins
/home/andrew/.config/kicad/6.0/scripting
/home/andrew/.config/kicad/6.0/scripting/plugins
/home/andrew/.local/share/kicad/6.0/scripting
/home/andrew/.local/share/kicad/6.0/scripting/plugins
/home/andrew/.local/share/kicad/6.0/3rdparty/plugins

On my system, the existing directory is /home/andrew/.local/share/kicad/6.0/scripting/plugins.在我的系统上,现有目录是 /home/andrew/.local/share/kicad/6.0/scripting/plugins。 I placed my plugin, tracks.py into this directory.我将我的插件 tracks.py 放到这个目录中。
After Tools->External Plugins->Refresh Plugins, I do not see my plugin in the menu.在工具->外部插件->刷新插件之后,我没有在菜单中看到我的插件。 The contents of tracks.py are as follows: tracks.py的内容如下:

from pcbnew import *

class SimplePlugin(ActionPlugin):
    def defaults(self):
        self.name = "Thick VCC Tracks"
    self.category = "Track adjustments"
    self.description = "Script to change the width of track named 'VCC' in a net"

    def Run(self):
    board = GetBoard()
    for track in board.GetTracks():
        if track.GetNetname() == "VCC":
            track.SetWidth(FromMM(1))

SimplePlugin().register()

Any advice on what to try next?关于下一步尝试什么的任何建议?

I hope you solved your problem by now.我希望你现在已经解决了你的问题。 But in case others stumble in here:但如果其他人在这里绊倒:

  1. I assume that the indentation in the plugin code you posted is not representative of your actual code, because the posted code won't compile.我假设您发布的插件代码中的缩进并不代表您的实际代码,因为发布的代码无法编译。

  2. In Kicad 6, plugins should be placed in the plugins folder under PluginContentManager.在 Kicad 6 中,插件应放在 PluginContentManager 下的插件文件夹中。 That folder is determined by the variable KICAD6_3RD_PARTY, and can be viewed or set in the Configure Paths dialog.该文件夹由变量 KICAD6_3RD_PARTY 确定,可以在“配置路径”对话框中查看或设置。

I don't know if any of the other paths you showed are actually looked at by Kicad, despite the suggestive names.尽管名称具有暗示性,但我不知道 Kicad 是否实际查看了您显示的任何其他路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM