【发布时间】: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