[SKiDL Feature Request] copy all fields from footprints to parts
Is your feature request related to a problem? Please describe. Normally, after adding a custom field (for example, MPN) to a footprint in KiCAD, and placing that footprint on a PCB directly in the PCBNEW, the custom field appears in the footprint. However, when creating a part in SKiDL, custom fields aren't added to the part automatically. I believe only a few standard fields like the description and the datasheet are added.
Describe the solution you'd like It would be nice if all custom fields were propagated from footprints to SKiDL parts (unless overridden).
You should be able to add fields to parts and they will get exported to PCBNEW via the netlist file:
r = Part("Device", "R")
r.fields["MPN"] = "A123456"
Let me know if this isn't happening for you or if you mean something else.
Hi! The above works. What doesn't work is if Device:R already has some fields in the footprint library. They don't get transferred to the Part by SKiDL and thus don't appear in the netlist. Later, it's possible to update the footprint with the library version in PCBNEW and the fields would appear, but it's not a nice flow. Also I believe DRC in PCBNEW complains that the footprint doesn't match the library because of the fields mismatch.
Just to be clear: Are you asking for fields in a .kicad_sym symbol file to be propagated into a Part? Or are you asking for fields in a .pretty footprint file to be propagated into a Part?
Specifically, what are the steps you took that failed to import fields/properties into a Part from a particular file?
Sorry for being unclear. I'm asking about kicad_mod footprint files.
First, test that the non-SKiDL flow works for library footprint fields:
- Open the footprint editor and create a new footprint.
- Edit the footprint properties (hit E).
- Add a new field Foo with the value Bar, hit OK.
- Rename and save the footprint, e.g. as
TestFPin the librarylib. - Open the PCB editor.
- Place the footprint (hit A, then choose the footprint saved in the step no.4.
- Select the newly placed footprint (all items if there are no pads/graphics).
- Open the footprint properties (hit E).
- You can see the field Foo appears with the value Bar.
Second, test that the SKiDL flow doesn't work. 1.
part = Part("lib", "TestFP")
generate_netlist()
- import the netlist in the PCBNEW.
- Select the footprint and open its properties.
- The field "Foo" is missing. The expectation is that there is the field Foo with the value Bar.
- Click "Update footprint from library" -> Update -> Close.
- Open the footprint properties again.
- The field Foo with the value Bar now appears in the list.
Like I mentioned above, the issue it seems is that SKiDL only considers only a few fields like Datasheet and Description when loading the part's footprint.
This is the thing I don't understand: you created a footprint and stored it into a footprint library that's passed to SKiDL, but SKiDL doesn't know how to parse footprints. It can only work with symbol libraries.
Perhaps you could send me the file that you're passing to SKiDL?
Hmmm, indeed. SKiDL doesn't read or check footprints at all, I have only realized it now.
My example above also has a mistake, it should have been Part("<some_symbol_lib>", "<some_symbol_name>", footprint="lib:TestFP").
Here are the test files for future reference: skidl-test.zip