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.

True False Logic Variable?

Cache_River_MillCache_River_Mill Member Posts: 193 PRO
I'm trying to suppress a feature that is used by multiple configurations. When all of the configurations are turned off, I would like to suppress the feature. Does anyone know if there is a way to do this?

Answers

  • john_mcclaryjohn_mcclary Member, Developers Posts: 2,859 PRO
    You can only set suppression state to one configuration.

    You also cannot change the value of a configuration from within the part studio.

    If this is a must, then you will need to make your part in featurescript and add some parameters on the precondition that you can pass through the configuration state.

    Otherwise, another hack would be to create a featurescript that takes the same parameters, but then just passes a variable that is passes a boolean variable back to your part studio, that you can use in your features.
    This won't suppress the feature, but an extrude of length zero is basically suppressed, except you will have an annoying red feature on the tree.
    As a sanity check, I changed it so the feature will say "true" or "false", so as long as it appears before the extrude (or whatever) then you will have your piece of mind that it was meant to be suppressed. I suppose it could also say something like "Next feature is suppressed" instead of false.

    https://cad.onshape.com/documents/042b7f640aa97881bfacab5b/w/2d178d46ad3a02fc5f792ebc/e/b73ebb92820c11b211e73499
    here you can see the extrude is active unless all three configurations are "off"

  • Cache_River_MillCache_River_Mill Member Posts: 193 PRO
    edited June 17
    Thank you John. I am currently using something similar to this for extrudes and things that use a variable. I have variables that I call "logic variables" that I place in different configuration tables. When a specific configuration is chosen, the logic variable changes from 1 to 0. Then these logic variables are placed in the extrusion distance input as a multiplier. When the logic is turned off, it multiplies the extrude by 0. Basically what you described.

    Perhaps I can re-write a feature and have the suppress check box replaced with the numbers 1 & 0. Then I could use my logic variables. I could have several logic variables, 1's and 0's multiplied by each other, then If all of them were set to 1, it would suppress or unsuppress the feature.


  • john_mcclaryjohn_mcclary Member, Developers Posts: 2,859 PRO
    Yea, sounds very similar. but this way you can do your logic in a easier to read and edit featurescript tab. rather than burying a bunch of math in each dimension

    I like having the feature rename itself directly above the 'red' feature helps reassure whoever come in behind you that those features are intended to be red in this configuration. for people like me who never want a red feature in a tree. I would be constantly double checking values there :wink:
Sign In or Register to comment.