KiCAD v8 python doc add track

i search the python documentation of the version 8 to find out how to add a new track to a pcb = GetBorad() but i dont get it.

if i try:
from pcbnew import *

pcb = GetBoard()
p1 = wxPointMM(0, 0)
p2 = wxPointMM(0, 1)
t = PCB_TRACK(pcb)
t.SetStart(p1)
t.SetEnd(p2)
pcb.Add(t)
Refresh()

i get:
exec(open(“/ALL/WiNDOWs/520/520-nofuture_2024/python/add_track.py”).read())
Traceback (most recent call last):
File “/usr/lib/python3.10/code.py”, line 90, in runcode
exec(code, self.locals)
File “”, line 1, in
File “”, line 9, in
File “/usr/lib/python3/dist-packages/pcbnew.py”, line 13598, in SetStart
return _pcbnew.PCB_TRACK_SetStart(self, aStart)
TypeError: in method ‘PCB_TRACK_SetStart’, argument 2 of type ‘VECTOR2I const &’

I think in v8 VECTOR2I is used instead of wxPoint in many places.

1 Like

thanks a lot!

is there a good documentation about all the changes in the python APi of KiCAD8?

I don’t know of any.