skidl icon indicating copy to clipboard operation
skidl copied to clipboard

[SKiDL Feature Request] copy all fields from footprints to parts

Open cyberhuman opened this issue 6 months ago • 6 comments

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).

cyberhuman avatar Jun 21 '25 08:06 cyberhuman

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.

devbisme avatar Jun 28 '25 03:06 devbisme

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.

cyberhuman avatar Jun 28 '25 03:06 cyberhuman

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?

devbisme avatar Jun 28 '25 18:06 devbisme

Sorry for being unclear. I'm asking about kicad_mod footprint files.

First, test that the non-SKiDL flow works for library footprint fields:

  1. Open the footprint editor and create a new footprint.
  2. Edit the footprint properties (hit E).
  3. Add a new field Foo with the value Bar, hit OK.
  4. Rename and save the footprint, e.g. as TestFP in the library lib.
  5. Open the PCB editor.
  6. Place the footprint (hit A, then choose the footprint saved in the step no.4.
  7. Select the newly placed footprint (all items if there are no pads/graphics).
  8. Open the footprint properties (hit E).
  9. 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()
  1. import the netlist in the PCBNEW.
  2. Select the footprint and open its properties.
  3. The field "Foo" is missing. The expectation is that there is the field Foo with the value Bar.
  4. Click "Update footprint from library" -> Update -> Close.
  5. Open the footprint properties again.
  6. 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.

cyberhuman avatar Jun 29 '25 04:06 cyberhuman

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?

devbisme avatar Jun 29 '25 15:06 devbisme

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

cyberhuman avatar Jun 30 '25 10:06 cyberhuman