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.

bug in using variables for parts studio linear pattern

david_lang457david_lang457 Member Posts: 87 ✭✭✭
If you use a variable for a distance when doing a linear pattern in a sketch, it looks like it works (the right value shows up after hitting enter), but it's not saving the reference to the variable, instead it's just putting in the current value of the variable. If you change the variable, the pattern does not rearrange itself

you can go back after you finish the pattern and double click on the dimension and see that it's a number. you can then change it to a variable and it saves it

Comments

  • robert_scott_jr_robert_scott_jr_ Member Posts: 506 ✭✭✭
    David, please post a link to your document. - Scotty
  • david_lang457david_lang457 Member Posts: 87 ✭✭✭
    I created an example doc https://cad.onshape.com/documents/fe104aed4306566958bc70da/w/275f478cc40d2a41e0b28618/e/14379a93d126c9f3a3a71796

    I created a variable 'spacing' = 2 in
    created a sketch with two circles
    set a pattern with the top circle, changed the offset to #spacing, saved it, pattern is at a fixed 2"
    set a pattern with the bottom circle, changed the offset to #spacing, saved it, edited the offset again and again set it to #spacing, pattern is at 2"
    changed the value of #spacing to 3", the offset of the bottom changed, the offset of the top did not.
  • robert_scott_jr_robert_scott_jr_ Member Posts: 506 ✭✭✭
    Hello David. I see in your sketch that the 'offset' distance is, as you say, fixed. Are you saying that you had assigned that dimension the 'spacing' variable to the upper circles and it reverted to a fixed dimension on it's own? 
    In a copy of your document I changed that fixed dimension to the variable and future changes to the variable were reflected in both rows of circles.
    In an effort to see if the unwanted 'fixed' change would occur, I started a new part studio and recreated the sketch from scratch and assigned the 'offset' of both sets of circles to #spacing. In changing the variable, both sets of circles followed suit.
    Not sure what occurred in you sketch. - Scotty

  • david_lang457david_lang457 Member Posts: 87 ✭✭✭
    yes, If I assign the offset to a variable while creating the pattern, it sets it to the value of the variable. If I set it to the variable after the patttern is created it sets it to the variable

    this only happens if you set the offset to the variable before clicking to complete the pattern

    1. create a variable #s
    2. create a sketch
    3. create a shape
    4. select linear pattern
    5. select the shape created in 3
    6. double-click on the offset (default 25mm or 1 in) enter $s and hit enter twice
    7. click to finish the pattern
    8. save the sketch
    9. change the value of #s and see that the pattern doesn't change
    10. edit the sketch
    11. double click on the offset, see it is a constant, type #s and hit enter twice
    12. save the sketch
    13. change the variable and see that the pattern does change
  • robert_scott_jr_robert_scott_jr_ Member Posts: 506 ✭✭✭
    Yes. I see what you mean. Even if your in sketch edit, changing the variable value has no effect. Not what I would expect the behavior to be. Hope someone else responds; I'm curious.- Scotty
  • david_lang457david_lang457 Member Posts: 87 ✭✭✭
    by the way, it doesn't matter if it's a normal variable or a config variable (which you can change without exiting the sketch), what matters is if you try to set it to a variable while creating the pattern

  • eric_pestyeric_pesty Member Posts: 1,947 PRO
    by the way, it doesn't matter if it's a normal variable or a config variable (which you can change without exiting the sketch), what matters is if you try to set it to a variable while creating the pattern

    That does seem like an odd behavior...
    Side note: you can change the value of a "regular" variable while editing a sketch if you use the variable panel on the right. It's not related to the issue but I thought I'd mention it as it's quite a helpful shortcut...
Sign In or Register to comment.