I’m looking for a way to edit one property of a number of footprints.
For example, I have a number of components on my board which will not be populated but are there as a backup (things like a simple PI-filter, a 3 resistor attenuator,…)
When you add components to a schematic or footprint Kicad always displays both the reference designator and the value as part of the silkscreen.
Is there a way to select a range of components and set the property of the silkscreen to ‘Invisible’? Right now I have to edit each footprint, edit the value, put ‘Display’ to ‘Invisible’ and click OK two times.
The fastest way I see is to edit the pcb as a text file and add “hide” modifier after the object you’d like to make invisible. As an example, here is a snippet of a .kicad_pcb file from my recent project, you’ll see the “hide” modifiers on reference and value fields there:
Currently I’m using version BZR 5161 from 2nd of October 2014.
Quite recent…
Indeed, editing these properties in the text file mode is a possible way
forward.
But more interestingly I would like to see if I could manage this from the
scripting console.
Perhaps there is een API available to work on components?
Is there already a feature request for such a property editor? Otherwise
I’d add it to the Launchpad in the hopes it receives some more attention.
Hi tipofthesword,
Realise this is an old post, but a script to do what you want appears reasonably straightforward. The script below tests fine, presuming you know the references of the parts you’re wanting to change.
#!/usr/bin/env python
from pcbnew import *
pcb = GetBoard()
while True:
thing = raw_input('Reference to hide: ')
aModule = pcb.FindModuleByReference(thing)
if aModule:
aModule.Reference().SetVisible(0)
aModule.Value().SetVisible(0)
print('Module '+aModule.Reference().GetText()+': '+aModule.Value().GetText()+' is now hidden.')
else:
print('Module '+thing+' not found.')
again = raw_input('More? Y/N: ')
if (again != 'y') & (again != 'Y'):
break;
print('Done.')
References are case sensitive, so c1 is not the same as C1. This hides the reference and value in the currently open board in pcbnew.
This is an old thread, but thought I would throw this out there. I updated a bunch of footprints and needed to hide all the “value” fields as mentioned above. I opened the pcb file in Vim and ran a one-liner:
%s/^.* value .*)$/& hide
This could be done with Sed also, and changing “value” to “value 10uF” lets you be more selective. The power of KiCAD’s human readable file formats.
Currently going over @devbisme’s KiField code to see how this is done more properly than I do in my ugly code.
Should have an option to export the settings from CSV back into the kicad_mod repos in a couple of days/weeks.