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.

Options

Slider mate limits from variables

graham_lockgraham_lock Member Posts: 249 PRO

Hi,

I have a linear rail and carriage sub assembly:

Linear Rail and Carriage.png

The rail part studio has a configuration variable which sets its length.

The carriage part studio also has a configuration variable which sets its length.

The carriage is mated to the rail with a slider mate.

Is there a way to set the maximum slider distance using the rail length variable and then subtracting the carriage length - i.e. something like #railLength-#carriageLength?

Any help appreciated.

Thank you.

Best Answer

  • eric_pestyeric_pesty Member Posts: 2,272 PRO
    Answer ✓

    Sorry about that, I had a bit of a brainfart…

    Width mate isn't what you want! That will keep the carriage centered. The two mates with one sided limits is the way to go for this. I used a slider on one end a parallel at the other end as it's always best to limit the amount of "over-constraining" (even though two sliders should work).

    image.png

    https://cad.onshape.com/documents/32ee02b5a0eb0cb379088b95/w/f46611544b60908af42da832/e/5e5d4b5ef9e4ce08e7389937?renderMode=0&tangentEdgeStyle=1&uiState=685c1ad2f69fe80706902ced

Answers

  • eric_pestyeric_pesty Member Posts: 2,272 PRO

    Short answer no, but you could do it with two mates: one from either side with only one sided limits.

    Actually, never mind, remove the limits and use the newly added width mate!

  • graham_lockgraham_lock Member Posts: 249 PRO

    Thank you - do you have an example of how to set this up?

    I'm getting over constrained errors when trying to use a slider mate with a width mate.

  • eric_pestyeric_pesty Member Posts: 2,272 PRO
    Answer ✓

    Sorry about that, I had a bit of a brainfart…

    Width mate isn't what you want! That will keep the carriage centered. The two mates with one sided limits is the way to go for this. I used a slider on one end a parallel at the other end as it's always best to limit the amount of "over-constraining" (even though two sliders should work).

    image.png

    https://cad.onshape.com/documents/32ee02b5a0eb0cb379088b95/w/f46611544b60908af42da832/e/5e5d4b5ef9e4ce08e7389937?renderMode=0&tangentEdgeStyle=1&uiState=685c1ad2f69fe80706902ced

  • graham_lockgraham_lock Member Posts: 249 PRO

    Thanks Eric, that works well!

Sign In or Register to comment.