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.

Variables to show/hide features

Josy_LaJosy_La Member Posts: 82 ✭✭
edited September 2017 in Community Support
Hi,

Can I use variables to show/hide a feature based on length of part? Typically my part has 2 holes at each end but sometime a 3rd center is required if the length exceeds 36 inches. I have modeled the center hole separately thinking it may help but I don't know how to approach it so that the part is adaptive.

Can anyone help?

Best Answer

Answers

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    edited September 2017
    You can put that length into a parametric variable (either with a manual variable feature or with the Measure Distance custom feature).

    Then you can set the depth of your additional hole to something like
    (#Length > 36 in) ? (1.5 in) : (0 in)
    Parentheses optional. See the thread on Onshape expressions for this trick and more!

  • Josy_LaJosy_La Member Posts: 82 ✭✭
    Answer ✓
    Thanks Kevin it works perfectly.
Sign In or Register to comment.