Run Infobox with menu Tools->Infobox. Click on the parts list with the right mouse button, and choose settings. Pin nets of pcb must be allowed.
Close the window. Then go to the Pins tab and enter the word unconnected into the Net(PCB) window.
Click on the pins list with the right mouse button, and choose “Edit pins(complex)” application.
Enter the parameters of the cells as shown in the figure and click OK. All unconnected pins will be removed from the PCB. We filtered out unconnected pins as an example. Similarly, you can make an infobox filter for some other parameters and then change the size of the pads or holes.