Hi, I’d like to write a plugin for the schematic editor. The documentation I can find seems to deal mostly with the pcbnew Python package, which seems to only deal with the PCB editor. Is there a way to interface with the schematic?
Additionally, any guidance on how to write a plugin would be helpful! I’ve mostly been looking to other plugins as an example.
The Schematic-Editor does have Two ways of facilitating Plugin operations…
Using its Python Console (the Grey Icon)
Using the BOM-Tool - it doesn’t know what the Plugin you make is going to do, it just Runs the Plugin. So, your Plugin-code could take action on the schematic’s contents/etc…
I did this and demo’d a few times but, recently I cleaned out my system and now have only One of the ‘Schematic’ related plugins to demo (below)
Note that, just like with the PCB’s files, the Schematic’s file has commonality of items and user can create custom Fields and the Plugin can use them, too…
This approach is just Python and has no required content like the PCB plugins need so, start simple with just a ‘Hello’ plugin (can include a GUI)…
Spent a few minutes to further Demo using the BOM-Tool to Run a Python ‘Search & Replace’ Code that takes Action on Schematic contents…
Simple example without any consideration to anything beyond:
• Annotating then running Code to change Text in Symbols and Text-Fields.
• Then, Re-Annotating to get individual numbers assigned to the Replaced Text…
Amusing myself… Running my Tweaker App to Search&Replace