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.

Why can't I define a variable as a measured angle?

StephenGStephenG Member Posts: 370 ✭✭✭
It is possible with an "Assigned" variable



but not with with "Measured".


Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,688
    It is a limitation related to not being able to deterministically measure the correct angle each time. There are already tickets open on this but an additional vote wouldn’t go amiss. 
    Senior Director, Technical Services, EMEAI
  • S1monS1mon Member Posts: 2,989 PRO
    Much like the new trim/extend curve uses a helper point for determining which end to use, couldn’t something like that work for angle measurements?
  • StephenGStephenG Member Posts: 370 ✭✭✭
    I am not sure I fully understand the issue. Is it because without presumptions and/or additional information multiple valid angles exist?   

    as in...


    Would restricting measured angles to a 3 point method, where the 2nd point is designated the angle vertex and returning a value <=180 degrees address the issue? 
  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    You can do this with the custom Measure Value feature by @konstantin_shiriazdanov, but yes, you understand the issue correctly, the angle can flip unintuitively. If you happen to know that it's always going to be <90° you could use a function to force it to be the right one like this.

    Set #angle with Measure Value, then make a new variable also called #angle and make it equal to the following:
    min((180 * degree) - #angle, #angle)
    This will look at the measured angle and the supplementary angle and return the smaller of the two.
    Evan Reese
  • StephenGStephenG Member Posts: 370 ✭✭✭
    The "Measure Value" feature is definitely an upgrade to the "Measure Distance" feature script I have used in the past (now depreciated).

    Question: Why "(180 * degree)" instead of "(180 degree)"? I have never seen units applied using an "*".  


  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,068 PRO
    value with units= 1*mm, featurescript has units attached to their variables. Println a variable in featurescript and you'll see it's an object. This allows you to perform vector math with variables, add up volumes and most import add 1*in + 1*mm and get the correct answer.

    When you have to vectors selected, you don't know anything else. To make this work you'd have to pick 2 vertices to determine which angle you want. 

    Once you figure this out, post it, it'll be interesting.


  • EvanReeseEvanReese Member, Mentor Posts: 2,144 ✭✭✭✭✭
    @StephenG
    Oh yeah, that's a FeatureScript habit. That's the actual way to represent it, but the normal dialogue boxes automatically fixes it for you so if you type "1mm" it fixes it to "1 * millimeter" internally. you could totally just do (180deg).
    Evan Reese
  • outstandingoutstanding Member Posts: 56 ✭✭
    NeilCooke said:
    It is a limitation related to not being able to deterministically measure the correct angle each time. There are already tickets open on this but an additional vote wouldn’t go amiss. 
    The place to vote being here, I suppose.
Sign In or Register to comment.