How to use a 3rd party script in PCBNEW


#1

When I find a cool new python script (like this one https://gist.github.com/hanya/27931f7bb6d21957ac05), how in the world do I add it to PCBNEW and then how in the world do I invoke it?
Please reply using small words.
Thanks
Dan


#2

Please attach the version information of the KiCad version your’e using. (Help menu, either Copy Version Information or inside the About dialog.)


#3

Application: kicad
Version: (2018-01-02 revision b1b3a89f7)-makepkg, release build
Libraries:
wxWidgets 3.0.3
libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.60.0
Curl: 7.54.1
Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_SPICE=ON


#4

So you use daily builds on Windows. The script has to be somewhere where you can import it in a Python interpreter. Unfortunately KiCad at the moment doesn’t use the user’s home directory for scripts so you have to put it either in the Python’s own directory or KiCad’s installation directory, here it’s C:\Program Files\KiCad\share\kicad\scripting\plugins. For me it would require admin priviledges, so I’m not going to test this, but I believe that when you have added the file KiCad can find it. The script you mentioned isn’t an “Action plugin”, so you have to open the scripting console under the Tools menu. There import the file as a module. Then use a function from that module - for the mentioned script see its README.

I hope this is correct and that you know enough python to use the script.


#5

eelik - thank you. Too much for me to mess with, but that’s what I needed to know.


#6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.