← Back to team overview

kicad-developers team mailing list archive

Re: KiCad-Winbuilder Release 3.0


>  Hi,
> I've just tried Kicad-Winbuilder 3.0 and it successfully compiles. I'm
> eager to try the scripting. How do I invoke an example script in the
> console window (I'm a python newby).
> I've seen a couple of footprint wizards in the scripting\plug-ins
> directory. What command do I use to try one of these out?
> Also here are a few INITIAL observations so far.
> 1/ I can not close the scripting window using the close box in the top
> right hand corner, only Alt+F4 works for this.
> 2/ Focus is not persistent in the console window. When I click in the
> console window the cursor blinks at the command line as long as the mouse
> stays in the command window area.
> When I move (not click-just move) the mouse into the pcbnew window the
> command line cursor disappears.
> 3/ PCBNew takes a while to start up and will not shut down properly (has
> to be done in task manager). If I try to start it up again a "file already
> open" error message pops up. DrWatson is also evoked for some reason.
> Forgive me for posting this to the developer list. Please let me know if
> this is NOT the appropriate place for user experiences.
> Thanks.
> David.
Hi David,

1/ To close the scripting window, just click the "Show/Hide scripting
console" button on the main toolbar. The close button in the top right
applies to the PCBNEW application, not the scripting window.

2/ I see the loss of focus too. A bug report to the KiCad project would be
useful here.

3/ I see this too, but not all of the time. Sometimes it just takes ages
for PCBNEW to shutdown. Again, another bug report to the KiCad project
would be useful here too.

To get started you can look at the python footprint wizards under
kicad/bin/scripting/plugins. These are run from the module editor in
PCBNEW. Run Kicad, start PCBNEW and select the module editor. There is a
new icon on the main module editor toolbar which starts the footprint
wizard. All footprint wizards under the kicad/bin/scripting/plugins
directory are selectable and can be run from here.

The scripting console should be considered bleeding-edge. The place to
start is to import pcbnew and get a reference to the current board object:

import pcbnew
board = pcbnew.GetBoard()

Then you can start doing things. I don't think there's much in the way of
examples at the moment. But you can look in the KiCad source tree, which
has some stuff you can look at: src/kicad/pcbnew/scripting/examples.
There's currently no way that I know to load a script into the scripting

Good Luck!

Best Regards,