Any way to get a count of smd pads?

Many vendors ask for a total number of SMD pads on the outer layers. Is there a way to get this statistic?


This is a solution for 5.1.x. Open python console in pcbnew and run the following script:

import pcbnew
b = pcbnew.GetBoard()
fp_list = b.GetModules()
smd_pads = 0
for fp in fp_list:
    pad_list = fp.PadsList()
    for pad in pad_list:
        if pad.ShowPadAttr() == 'SMD':
            if pad.IsOnLayer(pcbnew.F_Cu) or pad.IsOnLayer(pcbnew.B_Cu):
                smd_pads = smd_pads + 1
print smd_pads
1 Like

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