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

Feature Request: Set new DNP field based on configured variant #188

Open
myamigo opened this issue May 29, 2023 · 4 comments
Open

Feature Request: Set new DNP field based on configured variant #188

myamigo opened this issue May 29, 2023 · 4 comments

Comments

@myamigo
Copy link

myamigo commented May 29, 2023

Thank for this script. It's very useful!

I'm wondering if the following could work as a way to better leverage support for the new DNP field in symbols.

Rather than including the new DNP field as an input to your script as it does now with the new code added to isFitted(() could you instead set that field based on the DNP status as determined by the other tests in the same function (under # Variants logic). With this change when isFitted() exits the component's DNP flag will be explicitly set or cleared based on the variant field settings +BLAH, -BLAH.

After running the script for a particular variant the schematic would then visually display the DNP status for every component in the design.

I tried to figure out where and how to hack some changes in to test this but I got stuck not knowing how to set a field attribute.

Thank again!

@SchrodingersGat
Copy link
Owner

@myamigo I feel that this idea is somewhat out of scope for the project, but if you come up with a way of implementing this seamlessly, let me know!

@set-soft
Copy link
Contributor

Hi @myamigo !
Take a look at KiBot, it can generate printed outputs of each variant, you can even generate new schematics and PCBs with the variants applied.
KiBot can use KiBoM to generate the BoMs, as a quick start option, but also implements a BoM output that is strongly inspired (read: I took a lot of @SchrodingersGat good ideas and code) that goes even farther. It supports KiBoM style variants, but also KiCost and iBoM variants.
It runs on Linux, WSL and docker images. Not plain vanilla Windows (i.e. without enabling WSL or without installing docker).

@set-soft
Copy link
Contributor

set-soft commented May 30, 2023

Hi @SchrodingersGat !

with a way of implementing this seamlessly, let me know!

Lamentably the Python schematic API (in the roadmap for 6.0) was never implemented, so you must deal with the schematic format, which isn't well documented. KiBot can read and write schematic for KiCad 5, 6 and 7 (even for 7.99). So it can load a schematic, apply the variants to the DNP attribute and store it to disk. Is really complex.

@myamigo
Copy link
Author

myamigo commented May 30, 2023

Hi @SchrodingersGat, I will share whatever I come up with.

I was hoping to learn how to set a field in a symbol and since your script touches every component I figured the simplest approach would involve modifying your scripts. If you are able to suggest a command that would allow me to set a field in the symbol rather than just reading then I'll work with that. Otherwise it seems I'll have to complete a deep dive into KC Python scripting.

Thanks for the KiBot suggestion @set-soft. I had looked at this previously but I am on Windoze and while I have WSL installed I am not quite prepared to commit to the effort required to get fully setup in that environment.,

Thank you both.

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

3 participants