Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Slider mate limits from variables

Hi,
I have a linear rail and carriage sub assembly:
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_pesty Member Posts: 2,272 PRO
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).https://cad.onshape.com/documents/32ee02b5a0eb0cb379088b95/w/f46611544b60908af42da832/e/5e5d4b5ef9e4ce08e7389937?renderMode=0&tangentEdgeStyle=1&uiState=685c1ad2f69fe80706902ced
0
Answers
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!
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.
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).
https://cad.onshape.com/documents/32ee02b5a0eb0cb379088b95/w/f46611544b60908af42da832/e/5e5d4b5ef9e4ce08e7389937?renderMode=0&tangentEdgeStyle=1&uiState=685c1ad2f69fe80706902ced
Thanks Eric, that works well!