Kicad newb here… started a botu 2 weeks ago.
I have a PCB already laid out. its got about 800 parts. I just learned about LCSC part numbers, and how to include those in the BOM. I want to add the LCSC part numbers to the individual footprints. I started doing it manualy, but realized I saw a thing about a scripting tool so i checked that out. I can manage to list the parts, but I can figure out how to list the footprint properties. So I opened the project.kicad_pcb in a text editor to see if I could figure some other way to script the property tags.
From project.kicad_pcb:
(footprint "HXCFootprints:C_0603_1608Metric"
(layer "F.Cu")
(uuid "00000000-0000-0000-0000-0000642a636d")
(at 250.95 84.45 -90)
(descr "Capacitor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 76, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator")
(tags "capacitor")
...
(property "LCSC" ""
(at 0 0 0)
(unlocked yes)
(layer "F.Fab")
(hide yes)
(uuid "212693e4-e4b0-4c3d-8afa-fd1639ad3136")
(effects
(font
(size 1 1)
(thickness 0.15)
)
)
)
what I thought I might do was write a python or bash script to just add LCSC “” property tags though out the document at the relevant locations, but now I’m tripping over this uuid attribute which I don’t know how to generate or deal with.
what I really need is a tutorial or something on how to use the scripting tool, and how to make changes to the footprints. I tried reading the API, but IDK, I’m kinda confused by that too. I looked at MAP_STRING, FOOTPRINTS, GetFootprint(), setProperty, SetProperties() and a variety of other functions, but man, i cant figure it out.
is there a tutorial or something to walk me thought the kicad scripting?
how is the uuid property determined?