Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Blacklist/Whitelist Configurations?
However, one thing I'm not clear on is how to prohibit certain configurations (or make only certain configurations allowable).
Eg. Say I have a configurable part for which some configurations are technically impossible or are not available for business/economic reasons.
How do I only allow configurations that are possible/permitted?
Best Answers
-
MichaelPascoe Member Posts: 2,012 PROThis is currently not possible. There is an improvement request you can vote on here: Conditional Configurations
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴2 -
Caden_Armstrong Member Posts: 194 PRO+1 to that improvement request, I agree this is an improvement that should get made, but I also like a good work around.
Its technically possible with FeatureScript, but the process of defining the blacklist/white listed configurations takes a bit of manual work. (Either requires typing it out, or creating a validation function).
I made a feature that runs through the current configuration, and if it matches something in the blacklist, it deletes all the bodies and shows an error.
This prevents a user from using the part in an un-allowed configuration. It still can be "used" but the part at least won't appear.
Its featurescript, so you have lots of option on what it could look like. Generate a red cube with "NO" inscribed on it, etc.
The neat thing about this is that you don't need to define the entire configuration, just which variable combinations are black listed.
You could also just define logic. Ie, if one variable is bigger than another or if one is a multiple of another, etc.
https://cad.onshape.com/documents/583d561ba4858700c3193753/w/193e12ae51a0915a6aa67c8f/e/d4283c2dd00df6ae952bb2c8
I wrote an article last week about using configurations in featurescript if anyone is curious
https://www.smartbenchsoftware.com/post/featurescript-and-configurations
www.smartbenchsoftware.com --- fs.place --- Renaissance
Custom FeatureScript and Onshape Integrated Applications2 -
Kyle_Burt Member Posts: 11 PRO
There is a clunky method that can be used, and works for assemblies (thanks @Caden_Armstrong for sharing the FeatureScript to help with parts!)
-Rename your document element from the Tab Manager with some sort of flag language in it (ex: "Shaft Assembly" gets renamed to "Shaft Assembly: Blacklisted")
-Make sure that only the "whitelist" configurations have configured assembly properties applied
-Any configurations that don't have configuration properties default to a configuration name of "Shaft Assembly: Blacklisted" which will appear in the assembly tree as well as any BoM's it's used in.
-This can at least act as a flag to whoever is trying to use the part/assembly to stop and figure out why it says Do Not Use.
Not perfect by any means, and seeing "Blacklisted" in an element name would likely lead me to avoid it, or be confused enough to track down the author to learn more. There would likely need to be a staff training element involved.
2
Answers
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
I don't think conditional configurations covers a whitelist/blacklist approach. I'll make a new improvement request.
See example:
https://cad.onshape.com/documents/d2d3382aa18189471db96624/w/bfdb4819bc7e743e462a92ad/e/671f31135deee56ac9da53da?configuration=List_CfK1kQIjtoTHRj=_2&renderMode=0&tangentEdgeStyle=1&rightPanel=configPanel&uiState=66bba56226978f7198c36edb
I've updated my improvement request with the below screenshot showing the end result of this system when the user configures the part to an invalid configuration:
Its technically possible with FeatureScript, but the process of defining the blacklist/white listed configurations takes a bit of manual work. (Either requires typing it out, or creating a validation function).
I made a feature that runs through the current configuration, and if it matches something in the blacklist, it deletes all the bodies and shows an error.
This prevents a user from using the part in an un-allowed configuration. It still can be "used" but the part at least won't appear.
Its featurescript, so you have lots of option on what it could look like. Generate a red cube with "NO" inscribed on it, etc.
The neat thing about this is that you don't need to define the entire configuration, just which variable combinations are black listed.
You could also just define logic. Ie, if one variable is bigger than another or if one is a multiple of another, etc.
https://cad.onshape.com/documents/583d561ba4858700c3193753/w/193e12ae51a0915a6aa67c8f/e/d4283c2dd00df6ae952bb2c8
I wrote an article last week about using configurations in featurescript if anyone is curious
https://www.smartbenchsoftware.com/post/featurescript-and-configurations
Custom FeatureScript and Onshape Integrated Applications
There is a clunky method that can be used, and works for assemblies (thanks @Caden_Armstrong for sharing the FeatureScript to help with parts!)
-Rename your document element from the Tab Manager with some sort of flag language in it (ex: "Shaft Assembly" gets renamed to "Shaft Assembly: Blacklisted")
-Make sure that only the "whitelist" configurations have configured assembly properties applied
-Any configurations that don't have configuration properties default to a configuration name of "Shaft Assembly: Blacklisted" which will appear in the assembly tree as well as any BoM's it's used in.
-This can at least act as a flag to whoever is trying to use the part/assembly to stop and figure out why it says Do Not Use.
Not perfect by any means, and seeing "Blacklisted" in an element name would likely lead me to avoid it, or be confused enough to track down the author to learn more. There would likely need to be a staff training element involved.