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

Making Part number permanent field in BOM export #456

Closed
anshulj07 opened this issue Jul 17, 2024 · 4 comments
Closed

Making Part number permanent field in BOM export #456

anshulj07 opened this issue Jul 17, 2024 · 4 comments

Comments

@anshulj07
Copy link

The goal is to extract various component details including "PartNumber", "Value", "Footprint", and custom fields to generate a comprehensive Bill of Materials (BOM).

Issue:
The "PartNumber" field, which is standard in our KiCad component definitions, is not being correctly displayed or included in the generated BOM. Unlike other default fields like "Value" and "Footprint".

Steps Taken:

I modified the generate_bom function to handle the "PartNumber" field. The function was adjusted to fetch and append the "PartNumber" from each component's data:

elif field == "PartNumber":
fields.append(f.partnumber)

FYI: I am generating bom using command.

However, it appears that there might be a mismatch or an error in fetching this field, possibly due to incorrect field naming or access method.

image

@anshulj07 anshulj07 changed the title Inconsistent Handling of "PartNumber" Field in BOM Generation Making Part number permanent field in BOM export Jul 17, 2024
@qu1ck
Copy link
Member

qu1ck commented Jul 17, 2024

f.partnumber is not a valid field of a footprint class, that's not how you access custom fields.

You should not have to modify the code at all, when you simply tick the part number in the ibom config, does it not work? Can you post an example board file where it does not work?

@anshulj07
Copy link
Author

So I don't want to have to tick the part number field in Kicad every time before exporting. This is why I said I am using the command line to generate the bom.

I want to make it a default tick field so that everytime I export bom file. It should export partnumber column as well.

@qu1ck
Copy link
Member

qu1ck commented Jul 18, 2024

Then pass the --extra-fields argument. Run cli with --help to get all options.

@anshulj07
Copy link
Author

This issue can be closed.

So, I modified some code and moved the code to plugins. Now every time I export, I don't have to select part number. The reason I did this is because I some other use case where some API calls will be made to internal system to crawl over part numbers.

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

2 participants