Python scripting, looking to export custom symbol fields

Hello, I am looking at exporting BOMs and pick and place information from KiCad for our own equipment, using a custom plugin. While I have pretty much have been able to adapt this from sources found on the net, I am unable to find out how to get the custom user fields that are included within the symbols.

I can find the package name by module.GetFPID().GetLibItemName()
The part reference by module.GetReference()
The value by module.GetValue()
The position data using module.GetPosition() and module.GetOrientation()

The field I am trying to obtain holds the items pick and place name set within the symbol, which then points to a specific footprint. Is there a method that I can use to read the custom fields within ‘module’ or should I be looking elsewhere to find this information. Something tells me I have to compare with the netlist file to compile said information.

Thanks in advance.

In kicad 5.1 and earlier custom fields don’t get propagated to pcbnew so the information is not available in pcbnew api. You still can manually parse schematic file or netlist file or bom export xml file and get custom fields that way. I can give you some pointers if you are interested in doing that.

In kicad nightly use footprint.GetProperties() to get all the fields.

Hi thanks for the reply.

So that explains a few things, I have not missed those fields as they are not accessible. I do have a script that exports these fields via the schematic so I guess I’ll have to merge the two outputs to obtain the pick and place data format that we require.

Personally I do like the look of the nightly but from a production point of view if we are looking to move to Kicad then ultimately it has to be a stable release as V6 is probably too far away at the moment.

Thanks again for the info.

Maybe KiField is useful to you:
https://xesscorp.github.io/KiField

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.