What I’d like to do is have the BOM on the schematic page. At work what I normally do, with different software, is create an OLE link on the schematic page to an excel spreadsheet. This link would ensure the BOM on the schematic is updated whenever the excel file is changed. The only way I can see to do this in KiCAD is to place an image of the BOM onto the schematic page, then update the image whenever the BOM changes. Is there a better way to do this?
The cool thing about Kicad is the files are just text files, with an emphasis on readability.
I am no expert … (yet!)… I opened up a .sch file to see what a text block looks like:
Text Notes 7600 4750 0 60 ~ 0
This is the first line of text \nThis is a second line of text.
So it would be easy to have a python script to replace that line of text that appears after the “Text Notes 7600 4750 0 60 ~ 0” line.
In this example:
x position = 7600
y position = 4750
text height = 60mils
The only thing about text lines is you cant set them to be anchored top left (really wish you could, I often re-position text after adding lines because of this). You would have to place your BOM in the middle of the page, and it would grow up and down from the middle.
Maybe someone knows a better way…
That’s very interesting. I could definitely work with that and make a python script, however, I don’t see a way to insert or make the text into a table with cells and a border. Do you know how to do that, or if it’s even possible?
Hi,
Well instead of one big text note, you could separate the data according to columns.
Each column as a new “Text Notes” at different X positions.
And then use the “Wire Notes Line” function to draw your border. Its basically a decorative line as opposed to a track.
Wire Notes Line
0 100 200 100
in the format X1 Y1 X2 Y2…
In the above example it draws a horizontal line from X 0 to 200, and Y position 100.
Yes not super easy and would be quite tedious. Guess you after something like Altiums drawing outputs.
Kind Regards
Hi,
that’s a great hint. I have tried and it works. One litte downside: If I change a value e.g. 200nF to 300nF in the .sch datatfile than it is only shown after closing an reopening the schematic. Is there a way for instant change like in notepad++ which infoms that a change in the underlying file has occured?
I’ve written a lot of perl scripts to modify SCH files, this would be a 2 day task at the most, very strait forward, but would be a static hierarchical sheet (last page). Might do it if I find a few free cycles. But it will be a perl script, so you would need to run it from a CLI (aka bash shell). An interactive spreadsheet would be awesome, however it would need to be coded in schema, I would love to see this in a later version of KiCad. I don’t normally share too many of my perl scripts because there is an effort to use python as an API into kicad. However, python is only support on the pcbnew side. Perl is way easier to parse sch files, thus perl. I expect that once eeschem is rewritten to match the pcbnew file/lib format methodology, there will be some python API support. This hopefully will be better than the present solutions. How badly do you want this?
Hi,
I am not quite sure if your input answers my question. I am planning to write some supporting programs that will make my work with KiCAD easier or simply because I enjoy doing it. I use either c++ or visual basic as programming language (I am not familiar with python). But my question really concerns the updating. When I change a device in the KiCADs library editor and save it the schematic is updated automatically. I would like to know if there is a way to trigger this update if I change the .sch file by an external program.
So are you wanting to make a change in a symbol inside a lib? Then have that update while eeschem is running? If memory serves me right you would need to reload the library you are modifying. Not so auto magic…
right,
I was looking for ways to create some supporting software. To me the easiest way would be to simply change things in either in the lib file or (for active projects) to make changes in .sch, .pro or .kicad_pcb. After having done this it would be nice if the changes could be seen on screen for active projects.
Is there any update on this? Are there any plans on making this a feature? I had to resort to making a python script, but the table column wrapping gets quite complex.
Please start a new topic instead of necroposting in a 8-year old topic. File formats have changed a lot, .sch is now .kicad_sch so a lot may be inapplicable. You can use links to refer to older discussions.