Variables to show/hide features

Josy_La
Josy_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_1
    kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565 image
    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_La
    Josy_La Member Posts: 82 ✭✭
    Answer ✓
    Thanks Kevin it works perfectly.