Python - update footprint

Hi,

is there a python function to update a footprint in pcbnew? Say I have a placed component with a footprint and I change something in the footprint but the footprint’s name remains the same. To apply the change I have to click to ‘change footprint’ button in the component’s properties. Can it be done via python scripting? i.e. for refreshing all footprints or changing some of them?

Thanks

On the latest nightlies (at least), by right clicking a footprint you have an option “Update footprints…” and there you have options to update all footprints that match some conditions, I guess you can look there.

Other option is to change the footprint in EESCHEMA, click the “table” icon to Bulk edit fields in symbols; change the footprint for the items you need (you can group the items so it is easier to bulk edit); go to PCBNEW and push changes from schematic (F8)

This is also true in 5.1.x

The change footprints stuff is not to be used for this task, so I guess @jerabj is on an outdated version of KiCad or has not realized that the workflow changed.

Thank you, I did not notice this function, it helps a lot. But my original question was wheter there is a python function to do the same in pcbnew? i.e. function to update component’s footprint or to change its footprint?

What you want can be achieved with python but there isn’t one single function to do it.
You have direct access to footprints on the board that you can modify in place with python or remove and replace with another footprint. You can load and save them to libraries etc.
So ask more specific questions or search on the forum, most of the typical stuff has already been answered.

1 Like

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