How to change the Component Placement plugin script?

Hello everyone, how are you? I have a small problem and I need your help. A member of a community needs to generate the positioning files in .csv format, however, he needs to change the native header of kicad. I asked Seth Hillbrand if this would be possible, he said no, so after researching, I found the “Component Placement” plugin. I installed it, but now I would like to know how I can change the header and make it effective in the plugin. I installed VSCode, but it is showing an error when importing pcbnew. I thought that updating the “model.py” code would already update it in the plugin itself, but it doesn’t. Can anyone help me? The header has to be default every time it opens?

Using the plugin, I have these native fields, but I need to change them. In the “model.py” file I can change the “headers” line, but I need this to be updated to check the changes.

These are the new fields that I want to make native through the plugin when exporting.
image

Here is the plugin folder on Github:

I am the founder of the KiCad Brasil Community: kicadbrasil.com.br

That is not really an error! Its just that you run it in wrong python. The module pcbnew is not available in your python, but is available in kicads python.

How do I do this? Can you guide me? I saw here that there is Python.exe in the KiCad files

Just save it to your plugin directory. Choose Tools → External plugins → Refresh inside the PCB editor, then run it in kicad as you would normally.

To get IntelliSense working, you can use a configuration like this (update the paths according to your version):

No need to manually enter paths in a json file, just ctrl-shift-p and choose interpreter
image

One of the options will be to select a python executable, it will pull it’s libs automatically.

1 Like