Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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?

Oliver_CouchOliver_Couch Member Posts: 226 PRO
I like Onshape's independent variable approach to configurations - it just makes sense and should be the de facto way.
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

  • MichaelPascoeMichaelPascoe Member Posts: 2,012 PRO
    Answer ✓

    This 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 🔴
  • Caden_ArmstrongCaden_Armstrong Member Posts: 194 PRO
    Answer ✓
    +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 Applications
  • Kyle_BurtKyle_Burt Member Posts: 11 PRO
    Answer ✓

    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.

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 2,012 PRO
    Answer ✓

    This 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 🔴
  • Oliver_CouchOliver_Couch Member Posts: 226 PRO
    Bugger, that's a nuisance for rolling out configurations on parts for wider use without resorting to unwieldy tables.
    I don't think conditional configurations covers a whitelist/blacklist approach. I'll make a new improvement request.
  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    Depending how large your set of configurations is, you might be able to use a "derive" (or a sub-assembly set to "display parts only" so it's transparent to the BOM structure) a "master" part with all the possible permutations to create sub-sets of configurations.

    See example:
    https://cad.onshape.com/documents/d2d3382aa18189471db96624/w/bfdb4819bc7e743e462a92ad/e/671f31135deee56ac9da53da?configuration=List_CfK1kQIjtoTHRj=_2&renderMode=0&tangentEdgeStyle=1&rightPanel=configPanel&uiState=66bba56226978f7198c36edb

  • Oliver_CouchOliver_Couch Member Posts: 226 PRO
    The end goal is to prevent a user from being able to use/insert a configuration that is technically valid but say not available from the supplier. The configured properties page is likely the best UI to manage it from.

    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:

  • Caden_ArmstrongCaden_Armstrong Member Posts: 194 PRO
    Answer ✓
    +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 Applications
  • Kyle_BurtKyle_Burt Member Posts: 11 PRO
    Answer ✓

    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.

Sign In or Register to comment.