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.

Parametric Related - Adding Equations.

robert_melascagliarobert_melascaglia Member Posts: 43 EDU
Greetings

Lets say I placed a rectangle in a sketch, and dimensioned the short-side (w) ; could I then use an expression such as h=1.5w as the long-side?

thanks,
Robert

Comments

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    @robert_melascaglia

    Variables are set using the Variable feature in the Part Studio. If you create a Variable feature before the Sketch feature, you can define w as whatever length you want, and then use "#w" as width and "1.5 * #w" as the length.

    https://cad.onshape.com/help/Content/variable.htm
    Jake Rosenfeld - Modeling Team
  • robert_melascagliarobert_melascaglia Member Posts: 43 EDU
    Thank you Jake - I will investigate; although I was sure Onshape had that covered.
  • mahirmahir Member, Developers Posts: 1,307 ✭✭✭✭✭
    The Measure Value FS is handy for things like this if you don't want to create the variable ahead of time, or your relation is based on a measurement that is not directly dimensioned.
  • robert_melascagliarobert_melascaglia Member Posts: 43 EDU
    The Measure Value FS - I will give that a try also, thanks.
  • robert_melascagliarobert_melascaglia Member Posts: 43 EDU
    Hello All


    I have another question with a graphic pertaining to "equation constraints."

    1.  I have two "construction lines (in red)" at angle "alpha (in green)."
    2.  I would like the line G-F (in blue" to be one-half the angle "alpha."

    How do I constrain the line G-F so it will always behalf as mentioned in 1 and 2 above.  Thanks for your time - Robert.

  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Hi. I'd use a variable, defined above your sketch in the feature tree, and then drive those angles in the sketch using the dimension tool.

    Cheers, Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,671
    @robert_melascaglia you could also draw a construction arc (shown as a in your diagram), constrain a point to the midpoint of the arc then constrain the line to the point. 
    Senior Director, Technical Services, EMEAI
  • robert_melascagliarobert_melascaglia Member Posts: 43 EDU
    Neil, nice solution; I'll let you know how that goes, thanks.
  • mahirmahir Member, Developers Posts: 1,307 ✭✭✭✭✭
    Similar to @NeilCooke’s solution, you can use sector lines along with an equal constraint between them all. This would let you make one angle be any fraction of another angle. Although, I would opt for using Measure Value and a variable if it got any more complication than 1/4. 
  • robert_melascagliarobert_melascaglia Member Posts: 43 EDU
    Neil - your the man.

    The line-angle made a "mad dash" for that mid-arc point; thanks.
  • robert_melascagliarobert_melascaglia Member Posts: 43 EDU
    mahir said:
    "Similar to @NeilCooke’s solution, you can use sector lines along with an equal constraint between them all."

    How would I construct the "sector lines", and constrained them how?  I tried to work that out but somewhat confused, thanks for your assistance - Robert.

  • mahirmahir Member, Developers Posts: 1,307 ✭✭✭✭✭
    Here’s an example where the right side angle is constrained to be half of the left angle. Mind you, I would use @NeilCooke’s method for something as simple as getting half an angle. But sectors are handy for more complicated fractions. 

  • robert_melascagliarobert_melascaglia Member Posts: 43 EDU
    Okay, I see; that is also interesting and I will try, thanks.
Sign In or Register to comment.