Footprint scripting - custom search path possible?


#1

I tried the search, but only relevant result seems to be this:

I’m looking for a way to influence this selection/list here and having KiCAD also check another folder…

I already checked the kicad files in the ini folder and the project file, but those paths seem ‘hardcoded’.
Anyone know where I can set up a custom search path that points to a folder of my own?


#2

Hi @Joan_Sparky
kicad reads a starting scripts here:

C:\Users\Joan\AppData\Roaming\kicad

“Startup script executed: C:\Users\Joan\AppData\Roaming\kicad\PyShell_pcbnew_startup.py”

you can add the following code there

### DEFAULT STARTUP FILE FOR KiCad:PCBNEW Python Shell
# Enter any Python code you would like to execute when the PCBNEW python shell first runs.

# Eg:

# import pcbnew
# board = pcbnew.GetBoard()

import sys
my_adding_path='C:/my_extra_path/'
if sys.platform == 'win32': my_adding_path = my_adding_path.lower()
if my_adding_path not in sys.path:
    sys.path.append(my_adding_path)

EDIT Oops, sorry this is working only for python console …