I am looking for an easy way to generate a BOM associated only with Top Copper Layer components ONLY on a multi-layer board. Ideally it would also only print surface mount components and ignore through-hole etc. Perhaps there is an way to edit the xsl file used in bom generation?
In this case tho bom can not be created from within eeschema. The information about where the component is located is only known by pcb_new.
But pcb_new does not know about costom fields added to the symbol in eeschema.
Ideally the bom tool is located outside of eeschema and pcb_new. It would use the data from both plus maybe from a material database to create a bom. (But i don’t think anyone will implement something like that in the near future. There are much more pressing issues like the new symbol library format.)
Maybe as a first step it would be possible to get the layer as an output of the bom generated in pcb_new. Then one could write a relatively simple script that combines the output of eeschema with the output of pcb new.
But to get this you might need to talk to the developers over at the bugtracker. (create a bug marked as wishlist) Not a lot of developers visit this forum regularly.
Also have a look at this tool by @pwuertz. Your original question sounds like you want to have some support for hand assembly:
What would greatly help this is if Kicad had a built-in way to re-annotate reference designators based on board location. (There is at least one such python script to do this, but honestly it belongs in Kicad itself.) At a previous job, the back-annotator put the suffix “r” on all parts on the back of the board. With that, it was possible to generate a BOM of only front-side or back-side parts.
That said, you can probably edit that renumber script to add the back-side indicator, and then edit one of the BOM-generation XSLT scripts to give a list of only front-side boards based on refdes.