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.

How do I apply multiple configurations on a single object?

dapugdapug Member Posts: 17 ✭✭
edited April 2023 in Using Onshape
I have a configuration scenario that requires a few checkboxes to show or hide items, AND those items are ALSO influenced by whether some other configuration was selected.  But I do not know how to accomplish this.  It seems like IF logic is what is needed on a Suppression so that I can decide whether to suppress or not based on some criteria that I can calculate.

Example:
Configurable Suppression | Shape Test (onshape.com)

Here are 3 shapes.  2 different layouts depending on configuration.



Second layout:



NOTE:
The checkboxes are supposed to SHOW or HIDE the individual shapes depending on whether checked (so, NO shapes should be showing in the first screenshot, and only CIRCLE should be showing in that second screenshot), but checkboxes do NOTHING right now, because I cannot apply Suppression to BOTH the Checkbox configuration, AND the "Layout" configuration (List) which already is configuring that property on those extrudes.  So instead, I created some local variables to be set when checked, in hopes to use those variables for LOGIC in order to know and do something elsewhere (such as Suppress/Unsuppress in the Layout, but only after double checking the variable to see if checked).

Why can't we have IF logic on configurations? (Suppression specifically). Meanwhile, is there some other way to approach this?

Comments

  • Rhett_RobinsonRhett_Robinson Member Posts: 119 PRO
    edited April 2023
    You can configure a configured part studio. Here is my solution if I am understanding you correctly: Configurable Suppression - Solution | Configuration of Configured Shape Test (onshape.com). This is how I got around this logic in the past.

    I deleted the variables in my version and relied on checkboxes set up in the original part studio, then derived that part into another part studio where you can configure configurations of a derived part.
  • dapugdapug Member Posts: 17 ✭✭
    You can configure a configured part studio. Here is my solution if I am understanding you correctly: Configurable Suppression - Solution | Configuration of Configured Shape Test (onshape.com). This is how I got around this logic in the past.

    I deleted the variables in my version and relied on checkboxes set up in the original part studio, then derived that part into another part studio where you can configure configurations of a derived part.
    Thanks Rhett, I think I get what you are saying and will look into that approach.  Your edited copy is blocked by permissions though (not set to public?)
  • Rhett_RobinsonRhett_Robinson Member Posts: 119 PRO
    Just fixed that. I forget that my permissions are usually turned off when I go to my personal account inside of my enterprise one. I have some other resources on configurations that I will dig up that will also be helpful for you.
  • Rhett_RobinsonRhett_Robinson Member Posts: 119 PRO
    This webinar from Neil Cooke helped me a lot: Advanced Configurations (onshape.com). Starting around 45 minutes into the video he explains variable arrays that you could also use to set this up. 
  • dapugdapug Member Posts: 17 ✭✭
    OK, yes, this is a cleaver approach, thank you!  Other ways are also welcomed.
  • eric_pestyeric_pesty Member Posts: 1,771 PRO
    There are some improvement requests about "configuration logic" but the "derived" approach seems to be the best way to restrict possible combinations. That's how I've done it in the past.
    With assemblies you do have the ability to configure the suppression of a folder in one table and the individual items within the folder so you effectively get "two levels" which can help but that's not available (hopefully "yet"...) in part studios.
  • shawn_crockershawn_crocker Member, OS Professional Posts: 859 PRO
    I would really like to be able to assign suppression with equations.  One possibility I have used before when I was really desperate, was to conditionally set a dimension to something that would repeatable create a desired failure somewhere.  Sometimes I will setup a configured assembly like this.  There are times when the suppression of an item needs to be controlled by the settings of more then one input.  Sometimes I will purposely have a length config on a part get set to 0 or something, and then the part fails within the assembly.  It sucks to be left with a nasty red warning in the tree but the desired effect is achieve.  The item no longer appears in the assembly or in a BOM.  I console myself over how terrible this seems by shifting my perspective a bit.  We put lots of focus on ensuring everything in the system resolves with stability.  We do this, and it is good.  The same focus can be placed on ensuring it fails.  And if we can count on it to fail, then the system must also be stable. And, it must also must be good.
  • chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 139 PRO
    One way we have done suppression with equations is by essentially creating a duplicate of an Onshape feature, with a parameter for suppression. For example, if you want to create your own version of the Extrude feature, all you need to do is go to the Standard Library Documentation, find the Extrude feature, then create our own Feature Studio in a document, paste in the code from the std, then we add a parameter that accepts a 0 (false) or a 1 (true). Then, we write in some simple code like: 
    if (definition.engineeringInput == 1)
         throw regenError("Feature is suppressed.");
    
    Though I imagine if you wanted to, you could write something a little more elegant that doesn't make the feature red, but instead just rename the feature to indicate suppression, then use return true; to end the feature. 
    Applications Developer at Premier Custom Built
    chadstoltzfus@premiercb.com
Sign In or Register to comment.