Closed set-soft closed 1 year ago
The collect_holes function doesn't support KiCad 5
collect_holes
pad.GetDrillSizeX()
pad.GetDrillSizeY()
pad.GetDrillSize()
pcbnewTransition
diff --git a/kibot/PcbDraw/plot.py b/kibot/PcbDraw/plot.py index f8990722..17f90185 100644 --- a/kibot/PcbDraw/plot.py +++ b/kibot/PcbDraw/plot.py @@ -626,13 +626,15 @@ def collect_holes(board: pcbnew.BOARD) -> List[Hole]: continue for pad in module.Pads(): pos = pad.GetPosition() + drs = pad.GetDrillSize() holes.append(Hole( position=(pos[0], pos[1]), orientation=pad.GetOrientation(), - drillsize=(pad.GetDrillSizeX(), pad.GetDrillSizeY()) + drillsize=(drs.x, drs.y) )) + via_type = 'VIA' if not isV6(KICAD_VERSION) else 'PCB_VIA' for track in board.GetTracks(): - if not isinstance(track, pcbnew.PCB_VIA) or not isV6(KICAD_VERSION): + if track.GetClass() != via_type: continue pos = track.GetPosition() holes.append(Hole(
Although I have no plans for supporting v5 (I only support the versions that are tested in CI), these changes are small and simple enough so I adopted them in 9c676a7494995c5aeab086e041bc0ca3967f472d.
The
collect_holes
function doesn't support KiCad 5pad.GetDrillSizeX()
andpad.GetDrillSizeY()
are KiCad 6 specific, you must usepad.GetDrillSize()
pcbnewTransition
, or just do the following: (IMHO simpler)