简体   繁体   中英

Kicad6 Plug-in does not appear in menu

I am not able to get an action plug-in to appear in the PCBNEW menu. 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. I placed my plugin, tracks.py into this directory.
After Tools->External Plugins->Refresh Plugins, I do not see my plugin in the menu. The contents of tracks.py are as follows:

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. That folder is determined by the variable KICAD6_3RD_PARTY, and can be viewed or set in the Configure Paths dialog.

I don't know if any of the other paths you showed are actually looked at by Kicad, despite the suggestive names.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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