← Back to team overview

kicad-developers team mailing list archive

Re: Getting kicad to work with wxPython Phoenix

 

On 23/11/17 16:17, miles mccoo wrote:
> 
> PS - AFAIK, the patch that triggered mention of dumping python due to
> wxPython still hasn't been denied or merged. :-)
> https://lists.launchpad.net/kicad-developers/msg31700.html
> 
> 
Hi Miles,

I just committed your patch. Thanks for your contribution to Kicad.

Now, if you want to improve Kicad scripting support (and I guess you do
;-), there's a bunch of tasks to do right away:

- glue between wxPoint and VECTOR2I and swigging out SHAPE_POLY_SET, SEG
and VECTOR2<> classes (see
https://bugs.launchpad.net/kicad/+bug/1728611). In the longer term, we
plan to use
VECTOR2Is in non-GUI related code, but until the legacy canvas is
factored out we must live with both types mixed.

- expose GAL SELECTION/SELECTION_TOOL through a simple python interface,
e.g:

pcbnew.SelectItems( [ item/list of items ] )
pcbnew.UnselectItems( [ item/list of items ] )
pcbnew.GetSelection()
pcbnew.ClearSelection()

- expose COMMIT/BOARD_COMMIT classes to enable undo & view updates (as
requested by other Python devs on the Kicad Forum):

# modification of a via diameter and adding a track. "via" comes from
the existing BOARD object, track is a new item created by the script
commit = pcbnew.COMMIT()
# inform PCBnew that we're going to modify the via object
commit.Modify(via)
via.SetDiameter()
track = TRACK()
track.SetStart(...)
track.SetEnd(...)
# add a new item (track) to the commit
commit.Add(track)
# push the commit - this will update the board view, connectivity
(ratsnest), commit changes to the BOARD object and create an entry in
the undo buffer
commit.Push("Change a via and add a new track")


- add simple calls to enable/disable visible layers/items
(https://bugs.launchpad.net/kicad/+bug/1712233,
https://lists.launchpad.net/kicad-developers/msg30372.html)

Tom


References