I don't know what you mean by the pads being zeroed out. Perhaps you could explain that, ie how it happens, what tool or function you use to accomplish it. You may be able to use that process or some byproduct of it to eliminate those pins from the netlist.
Also, if I was going to make a netlist, I'd start with the board's nets, not the pins.
something along the lines of
start a string or stringbuilder variable for the netlist
nets = pcbdoc.nets
for each net in nets
'add net name to netlist
pins = net.pins
for each pin in pins
'do some kind of check
if check passes then add the pin number to the netlist
The check you do to validate each pin could be based on a number of things - reference designator of the pin's component, cell name of the component, pad size, etc