Python create pad with plated through hole

I’m trying to create a through hole pad in a python plugin but struggling.

Any clues on how to do this in KiCad 6 using python?

That helped a lot. This seems to work - no idea if it’s completely correct, but it generates what I need.

module = pcbnew.FOOTPRINT(board)
board.Add(module)
pad = pcbnew.PAD(module)
pad.SetSize(pcbnew.wxSizeMM(1.7, 1.7))
pad.SetShape(pcbnew.PAD_SHAPE_CIRCLE)
pad.SetAttribute(pcbnew.PAD_ATTRIB_PTH)
pad.SetLayerSet(pad.PTHMask())
pad.SetDrillSize(pcbnew.wxSizeMM(1.0, 1.0))
pad.SetName('A')
module.Add(pad)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.