Hey All,
Working on a script to export directly from PCBNEW the position of each pad on a board.
Originally I was just swapping all the pads with THT versions, then exporting the drill files, then converting that to the needed format externally, but wanted to try and export directly from KiCad.
I can get the pads via this code:
for pad in pcbnew.GetBoard().GetPads():
print( str(pad.GetX()) + "/" + str(pad.GetY()) )
But I’ve been struggling all day to find how to convert IU to MM.
MM to IU I can do via the pcbnew.wxPointMM class, but I can’t seem to find the reverse function.
I thought I had found the way with
pad.GetX() / pcbnew.EDA_IU_SCALE.IU_PER_MM,
but get
TypeError: unsupported operand type(s) for /: 'int' and 'property'
error with this.
Any help appreciated.