kicadScripts icon indicating copy to clipboard operation
kicadScripts copied to clipboard

No Attribute 'SetLineWidth' in KiCad nightly

Open TobisLab opened this issue 5 years ago • 5 comments
trafficstars

Hi,

I'm using a pretty recent nightly version of KiCad and always get this output when using your scripts:

C:\Users\Tobias\Desktop\kicadScripts-master>"C:\Program Files\KiCad\bin\python.exe" plot_board.py "C:\Users\Tobias\Documents\GitHub\uDice\uDice\uDice.kicad_pcb"
Traceback (most recent call last):
  File "plot_board.py", line 425, in <module>
    popt.SetLineWidth(FromMM(0.35))
AttributeError: 'PCB_PLOT_PARAMS' object has no attribute 'SetLineWidth'

Not sure if it's just the attribute name that has been changed or whether there are more changes.

TobisLab avatar Oct 26 '20 11:10 TobisLab

I actually don't think that call is required when plotting with SVG, it appears to be missing in v6. Which is kind of handy because we need a good way to detect if we are using KiCad v5 or KiCad v6, because there are some other changes needed to support the output from v6.

Can you give this version a try: 0f579d20d8889ce78545c2e21d396c0f765b349b

gregdavill avatar Oct 30 '20 06:10 gregdavill

Thanks a lot for looking into the issue!

Running the script doesn't show any errors any more:

C:\Users\Tobias\Desktop\kicadScripts-master>"C:\Program Files\KiCad\bin\python.exe" plot_board.py C:\Users\Tobias\Desktop\uDice\uDice.kicad_pcb
Merging layers...
Rasterizing...
Detected Inkscape version 1.0+
Merging layers...
Rasterizing...
Detected Inkscape version 1.0+

But this is all I'm getting, just the front, no back side file gets created. I also tried it with a few different board files, with the same result.

uDice-Front

I upgraded to the latest nightly build and Inkscape is v1.0.1

TobisLab avatar Oct 30 '20 10:10 TobisLab

Hmm. Are you able to share your KiCad design? I'll run some tests on windows tomorrow.

gregdavill avatar Oct 30 '20 14:10 gregdavill

Sure, here are the two boards I was trying it with: KiCad_files.zip

TobisLab avatar Oct 30 '20 15:10 TobisLab

Strange, it appears the scaling of layers is different from the SVGs generated on a windows machine.

I don't have much more time today to debug unfortunately.

gregdavill avatar Oct 31 '20 02:10 gregdavill