【问题标题】:Kicad6 Plug-in does not appear in menuKicad6 插件未出现在菜单中
【发布时间】:2022-12-28 20:11:13
【问题描述】:

我无法让动作插件出现在 PCBNEW 菜单中。我已经运行以下命令来确定路径:

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

在我的系统上,现有目录是 /home/andrew/.local/share/kicad/6.0/scripting/plugins。我将我的插件 tracks.py 放到这个目录中。
在工具->外部插件->刷新插件之后,我没有在菜单中看到我的插件。 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()

关于下一步尝试什么的任何建议?

【问题讨论】:

    标签: kicad


    【解决方案1】:

    我希望你现在已经解决了你的问题。但如果其他人在这里绊倒:

    1. 我假设您发布的插件代码中的缩进并不代表您的实际代码,因为发布的代码无法编译。

    2. 在 Kicad 6 中,插件应放在 PluginContentManager 下的插件文件夹中。该文件夹由变量 KICAD6_3RD_PARTY 确定,可以在“配置路径”对话框中查看或设置。

      尽管名称具有暗示性,但我不知道 Kicad 是否实际查看了您显示的任何其他路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多