5
\$\begingroup\$

I'm drawing a schematic in KiCad which has a lot of capacitors and resistors. Now i realised that for the sake of tidyness and to make it easier to read it would be nice to have those caps and resistors replaced for the smaller size symbols. Is there any way to do that without having to go through them one by one?

\$\endgroup\$
1
  • \$\begingroup\$ Do you mean symbol (schematic) or footprint? \$\endgroup\$
    – vtolentino
    Commented May 7, 2020 at 8:12

2 Answers 2

2
\$\begingroup\$

Replacing symbols

Although KiCad has no specific tool to perform that, you can try the following. Let's say you want to replace all resistor symbols R with a photo resistor, whose symbol is R_PHOTO.

Just open your schematic file project.sch with a text editor, replace all instances of Device:R with Device:R_PHOTO, save and close it. Just make sure that the replacement's symbol has the same amount of connections and match the replaced symbol. For resistors and non-polarized capacitors should work just fine.

Replacing footprints

You can use a python library kifield for that as follows:

  1. Install the library

pip install kifield

  1. Copy all fields of a schemactic project.sch to a csv file

kifield -x .\project.sch -i design_fields.csv

  1. The table should look like the following:
Refs,datasheet,footprint,value
C1,~,Capacitor_SMD:C_0603_1608Metric_Pad1.05x0.95mm_HandSolder,22u
C2,~,Capacitor_SMD:C_0603_1608Metric_Pad1.05x0.95mm_HandSolder,1n
C3,~,Capacitor_SMD:C_0603_1608Metric_Pad1.05x0.95mm_HandSolder,100n
D1,~,custom-footprints:SMA_DO-214AC,SS14
D2,~,LED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolder,YELLOW
  1. Replace let's say the 0603 cap size with an appropriate 0805 one using the replace all function of any text editor. save and close the csv file.
Refs,datasheet,footprint,value
C1,~,Capacitor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder,22u
C2,~,Capacitor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder,1n
C3,~,Capacitor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder,100n
D1,~,custom-footprints:SMA_DO-214AC,SS14
D2,~,LED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolder,YELLOW
  1. Import it back into KiCad

kifield -x design_fields.csv -i .\project.sch

Now your footprints should be updated

\$\endgroup\$
12
  • 1
    \$\begingroup\$ The change footprint feature is now built into PCBNew, you don't need any external scripting. \$\endgroup\$
    – awjlogan
    Commented May 7, 2020 at 8:53
  • 1
    \$\begingroup\$ @awjlogan I was not aware of it. Thanks for the info. \$\endgroup\$
    – vtolentino
    Commented May 7, 2020 at 8:53
  • \$\begingroup\$ I'm also afraid the schematic change by find/replace doesn't work - that was my first thought too, but it only works if both of the symbols' connection nodes are in the same place. \$\endgroup\$
    – awjlogan
    Commented May 7, 2020 at 9:05
  • \$\begingroup\$ @awjlogan What do you mean by both of the symbols's connection nodes are in the same place? I might have overlooked something, but I ran a small test and it seemed to work. I had some resistors replaced in a schematic of my own. \$\endgroup\$
    – vtolentino
    Commented May 7, 2020 at 9:08
  • 1
    \$\begingroup\$ @awjlogan got it. You are right. Just double checked it. Thanks again. \$\endgroup\$
    – vtolentino
    Commented May 7, 2020 at 9:21
1
\$\begingroup\$

There is a tool in eeschema: tools -> edit symbol library references.

This allows you to change the referenced symbol for symbols. However, be aware that if the pin positions of the two symbols differ then you will need to fix up the schematic afterwards.


For changing footprint assignments on mass use either the assign footprint tool (you can select multiple symbols to change with shift click) or the field editor. Both are found in the tools menu.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.