I am trying to draw place a drill programatically on a pcb and I am quite stuck.
here is what I did so far:
import pcbnew
board = pcbnew.LoadBoard('sampleboard.kicad_pcb')
newvia = pcbnew.VIA(board)
newvia.TopLayer="F.Cu"
newvia.BottomLayer="B.Cu"
newvia.SetDrill(400000)
pos=pcbnew.wxPoint(10,20) # I want to place the via at x=10mm,y=20mm
newVia.SetPosition(pos)
newVia.SetNet( )# Now I am stuck. I want to set net to 'AGND'