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

Linear Patterns with variable spacing

David_Bower1David_Bower1 Member Posts: 11 PRO
Making a linear pattern with unequal spacings is a common feature in cad but I can't find how to do it in Onshape. I can only find equal spacing. Can someone show me how to do unequal spaced patterns please? Do I create ab equal pattern and edit dimensions somehow?

Answers

  • Options
    S1monS1mon Member Posts: 2,367 PRO
    It really depends on what you’re patterning and how complex the “unequal spacing” is. Then there are issues around performance and ease of modification. An example (images, public models, etc) would help us guide you a lot. 
  • Options
    David_Bower1David_Bower1 Member Posts: 11 PRO
    Hi S1mon, All I want to do is pattern a line of hole features where the first and last spacing is different to the rest.
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
    If I needed what you describe on a real project, I'd just manually model the end holes after the regular pattern. Here's an example of that.

    BUT since i'm replying here for the fun of it I'll show some unintuitive, complex ones too, which could be valuable in certain cases (like modeling guitar fret spacing). They are all based on using a feature pattern on variable features so the variable values change each time the feature pattern loops over those features. I made the var
    #i = 0
    and then another one
    #i = #i + 1
    If I pattern the second #i feature, it will increase by 1 every time the features loop, and you can use the number to drive all kinds of things. You could multiply it by a length like I do in this part studio or you could use it to index an existing array of values like in this part studio.

    In the first one, I'm also using some conditional logic to tell it how much the spacing should change each time. This is a ternary function. If you're not used to the syntax it's basically
    [true/false statement] ? [result if true] : [result if false]
    my true/false statement is
    (#i = 0)||(#i = #holes - 1)
    
    Which is asking "is #i is zero or the holes - 1". In other words, "is it the first or last hole?". If it is, then I use #endSpacing and if not I use #defaultSpacing

    I'm sure I'm leaving things out here because I don't know your comfort level with code, but feel free to ask followups. As I said, it's not intuitive, but it is a fun puzzle.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,395
    Yeah, I don't know of any CAD programs that let you do that easily (prove me wrong) and @Evan_Reese's solution is correct but somewhat over the top :smile: - I would probably make it out of 3 patterns: pattern for first and last, pattern for first and second, pattern for second to n.

    Senior Director, Technical Services, EMEAI
  • Options
    S1monS1mon Member Posts: 2,367 PRO
    I normally avoid sketch patterns, but they might be a good choice for this situation, depending on how many holes we're talking about, and which dimensions you want to control.


  • Options
    David_Bower1David_Bower1 Member Posts: 11 PRO
    Other cad packages have the ability to do variable patterns where you can edit the dimensions between each instance after creating it, or even disable some instances. Sketch patterns could be a good solution. I don't really have time to play with code as fun as it sounds  :)

  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,395
    Other cad packages have the ability to do variable patterns where you can edit the dimensions between each instance after creating it, or even disable some instances. 

    I know you can disable instances in other CAD, but can you name which CAD can edit individual dimensions? (For my education - Table patterns don't count). Thanks!
    Senior Director, Technical Services, EMEAI
  • Options
    David_Bower1David_Bower1 Member Posts: 11 PRO
    I am pretty sure it's possible in Creo and Catia to set variable spacing then edit the dimensions between each instance individually if it varies from the default you set.

  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
    I agree my "solutions" were over the top. I meant them to be examples of some of the powerful stuff you could set up in other situations. I do remember liking how Solidworks handled it. Here's a video showing the workflow https://youtu.be/oisuBea5LI8?t=113
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,395
    I agree my "solutions" were over the top. I meant them to be examples of some of the powerful stuff you could set up in other situations. I do remember liking how Solidworks handled it. Here's a video showing the workflow https://youtu.be/oisuBea5LI8?t=113
    Huh, I didn't know you could do that - must be a recent-ish addition? My apologies for doubting you @David_Bower1
    Senior Director, Technical Services, EMEAI
  • Options
    glen_dewsburyglen_dewsbury Member Posts: 582 ✭✭✭
    Is there an IR for this we can jump on?
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
    NeilCooke said:
    I agree my "solutions" were over the top. I meant them to be examples of some of the powerful stuff you could set up in other situations. I do remember liking how Solidworks handled it. Here's a video showing the workflow https://youtu.be/oisuBea5LI8?t=113
    Huh, I didn't know you could do that - must be a recent-ish addition? My apologies for doubting you @David_Bower1
    If my memory serves me, I recall doing this before I even switched to Onshape over 6 years ago, but I don't remember if it's been this robust for that long or not.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
Sign In or Register to comment.