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

Variables and sketch patterns! There's nuance to it.

Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
The recent update allows count variables to drive sketch patterns, which is really wonderful! Thanks, dev team!

This may seem like an obvious functionality, but there were actually some great reasons it hadn't been implemented from the start, and now that it has, there are some non-obvious implications that some of you may want to understand. Here's a quick explanation as I understand it.

Previously it hadn't been implemented because of some edge cases that would make models non-determenistic. That means that you might have two models with identical user inputs that could have different results, which would be a huge no-no for a tool like Onshape. This was a thing because of how flexible sketch patterns were designed to be. Sketch pattern instances can even be deleted, trimmed, or set to construction, which is great. However, if you delete your 4th instance, then take the count down to 3 and back to 4, it will come back. That could mean you'd have an extrude feature that would create 3 holes in the first case, and 4 in the second, even though everything is set up identically. That's not acceptable, so the previous solution was to not allow sketch patterns to use variables for the count. You can read more about it here: https://forum.onshape.com/discussion/comment/30219#Comment_30219

This new update had to get around that somehow, and here's how it works now:

- If you don't use a variable to drive it, it behaves exactly the same as before. modified/deleted instances will come back unmodified if you drop the count low enough to make the disappear, then raise it to bring them back. See the gif below. Notice the deleted one comes back and the dotted one becomes solid

- BUT if it is driven by a variable, the modifications stay in tact! That means an instance you delete will still be deleted when you roll the number down and back up. See the gif below.


- One implication here is that if you want to get an instance back but your pattern is driven with a variable, you need to remove it and add it back, like so.


Anyway, I was curious how they'd handle the determinism issue, so I did some testing. I hope this is helpful to someone.

Evan Reese / Principal and Industrial Designer with Ovyl
Website: ovyl.io

Comments

Sign In or Register to comment.