Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble using plugin #9

Open
burnt-past opened this issue Aug 10, 2021 · 11 comments
Open

Trouble using plugin #9

burnt-past opened this issue Aug 10, 2021 · 11 comments

Comments

@burnt-past
Copy link

Getting this error whenever I try to use this plugin.

I am on Windows 10 using KiCad 5.1.10

This is the Command I am using:

python3 "C:\Program Files\KiCad\bin\scripting\plugins/bom_csv_jlcpcb.py" "%I" "%O.csv"

Error:

Error messages:
Traceback (most recent call last):
  File "C:\Program Files\KiCad\bin\scripting\plugins\bom_csv_jlcpcb.py", line 48, in <module>
    out.writerow([c.getValue() + " " + c.getDescription(), ",".join(refs), c.getFootprint().split(':')[1],
IndexError: list index out of range
@howardt12345
Copy link

I have the exact same issue. Has this been resolved?

@burnt-past
Copy link
Author

No, I have not found a solution.

@zeeblaze
Copy link

I found a solution...open your kicad installation folder by right clicking on the kicad icon and select "open installation folder"...open "scripting" folder... you will see a "plugin" folder in it...open it and copy the files there...simple as that

@burnt-past
Copy link
Author

@zeeblaze , I am in a Windows environment. This is not applicable. If you would have looked at my original post, you would see that I am using the KiCad directory.

@zeeblaze
Copy link

Am also a windows user...and it worked for me ....try it..

@zeeblaze
Copy link

Your kicad will be the problem then... because I see the kicad you are using is 5.1.X version...

Well I use the same...but the thing is ..5.1.x uses python 2...so it's the older version of this script that will work for you 🙂

@burnt-past
Copy link
Author

That doesn't make sense, I have Python 3 installed and I'm using a higher version than what this plugin has been tested on.

@matteocordray
Copy link

Having the same issue...

@matteocordray
Copy link

@burnt-past The fix for me was to replace the [1] with a [0] in the code on line 48. Some designators are not in a folder and therefore only have one element

So line 48 should look like this:
out.writerow([c.getValue(),",".join(refs), c.getFootprint().split(":")[0]])

@CorentinLemaitre
Copy link

I am also windows user and manage to use python3 using the command py because python3 was not working for me.
py "C:\Program Files\KiCad\bin\scripting\plugins\bom_csv_jlcpcb.py" "%I" "%O.csv"

I get the same error :

Traceback (most recent call last):
  File "C:\Program Files\KiCad\bin\scripting\plugins\bom_csv_jlcpcb.py", line 48, in <module>
    out.writerow([c.getValue() + " " + c.getDescription(), ",".join(refs), c.getFootprint().split(':')[1],
IndexError: list index out of range

As @matteocordray have done I change the 1 to be 0 in line 48 and it worked !!! 🥳

Now it look like that : (line 48 and 49)

out.writerow([c.getValue() + " " + c.getDescription(), ",".join(refs), c.getFootprint().split(':')[0],
lcsc_pn])

@burnt-past
Copy link
Author

That Removes the data that you would want in the BOM. It seems the issue with the footprint name not containing a referenced library.

This will correctly print the values and remove a library name if it exists.

if ':' in c.getFootprint():
   out.writerow([c.getValue(), ",".join(refs), c.getFootprint().split(':')[1],
   lcsc_pn])
else:
   out.writerow([c.getValue(), ",".join(refs), c.getFootprint().split(':')[0],
   lcsc_pn])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants