Mostly human and part goose
by Charlie Rysenga
One of the best features of KiCad is the ability to crack open the files and edit them as structured text directly when the GUI does not have the function you are looking for.
My most recent example of this is hide all of the silkscreen reference designators on a board with over 600 components. Using the GUI to click on each component and uncheck the visibility layer would have taken forever. So, regex on the KiCad PCB source file.
Each component footprint has a basic structure with the line (fp_text reference R411 (at 0 -1.17) (layer F.SilkS)
. When you uncheck the visiblity option from the GUI hide
is appended to the end of the line. This makes a hidded reference designator (fp_text reference R411 (at 0 -1.17) (layer F.SilkS) hide
.
Knowing this an expression to select all of the reference designators becomes (\(fp_text reference \w*\d* .* F\.SilkS\))
. Using notepad++ for find and replace adds a small twist, you must reference the found text or you will only end up with your replace field. \1
is a vaild backreference to our found line. Thus the replace line becomes \1 hide
to hide all footprint references.