InteractiveHtmlBom icon indicating copy to clipboard operation
InteractiveHtmlBom copied to clipboard

Add %o option for output directory

Open hildogjr opened this issue 2 years ago • 5 comments

This is a feature request / improvement.

Add "%o" option to save the BOM into output directory used for Gerbers and other files.

Using version 2.4.1 on Kicad 6.99

hildogjr avatar Jun 06 '22 12:06 hildogjr

output directory used for Gerbers and other files.

Do you mean the last used path that pcbnew remembers in the plot dialog? It's not available in api, I think it's in project json file.

I imagine this would only be useful if you have non-standard output directory per project or generate multiple variants of the outputs or something like that. There are external projects that take care of this kind of automation (kibot), I don't think this is something Ibom should handle.

Or am I misunderstanding the request?

qu1ck avatar Jun 06 '22 14:06 qu1ck

This, this is correct (the dialog path). Usually I use "output - project" as this path, but the sometimes the "project title" is to long and I abbreviate it for the output folder name. So the path became different of "output - %p".

hildogjr avatar Jun 06 '22 14:06 hildogjr

The information is available on (setup (pcbplotparams (outputdirectory "???"))) pcb file but I think it is not exposed through the Python API.

hildogjr avatar Jun 06 '22 14:06 hildogjr

I could get it!

import pcbnew
output_folder = pcbnew.GetBoard().GetPlotOptions().GetOutputDirectory()

hildogjr avatar Jun 06 '22 15:06 hildogjr

Implemented on https://github.com/openscopeproject/InteractiveHtmlBom/pull/309

hildogjr avatar Jun 06 '22 16:06 hildogjr

This is kicad specific and not broadly useful. I'm not opposed to merging a fix for this but you'll have to put the work in and fix the issues I mentioned on your MR.

qu1ck avatar Aug 30 '23 17:08 qu1ck