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.

How do I retain a negative measured variable?

RhettRobinsonRhettRobinson Member Posts: 196 ✭✭✭

I am working through a process that requires the calculation of the distance along the global Y axis of sketch entities (in this example the center of circles) from the origin all on the same plane within a sketch. It is very important that I retain the positive or negative value. You can see from my images below that if I measure from the center of any of the circles to the origin (selected in that order) that I will get a positive or negative value. However, once I select measured variable the negative sign disappears. I am hoping to run this through some other features like Query Pattern, but without retaining the -Y measurements it doesn't work properly.

image.png

image.png image.png

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 2,803 PRO
    edited February 23

    Long time no see 😎
    I just updated image.png Measure Mate to be able to do this. It can also handle angles with signs as well.
    .


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
  • RhettRobinsonRhettRobinson Member Posts: 196 ✭✭✭

    Seriously 😂

    Brilliant, taking it a step further can you update it to allow mate connectors to also be selected in the entities box? 😁I should have actually shown that in my example.

  • RhettRobinsonRhettRobinson Member Posts: 196 ✭✭✭
    edited February 23

    @MichaelPascoe So I should have waited to reply, this doesn't look like it is doing quite what I need. 😔 Are vertices and mate connectors not available options as entities for selection?

  • MichaelPascoeMichaelPascoe Member Posts: 2,803 PRO

    There you go, I added it. Was a really simple change.
    .


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
  • RhettRobinsonRhettRobinson Member Posts: 196 ✭✭✭

    Maybe I am not understanding how to set it up properly, I don't seem to be getting a negative measurement in the y direction now that I have pulled in your update. I have tried both points or mate connectors in flipped order and it is still positive.

    image.png
  • MichaelPascoeMichaelPascoe Member Posts: 2,803 PRO

    Distance measurement sign is based on the input mate's xy plane, see the example tab in the document. That said, it still might not be what your going for, not sure yet.


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
  • RhettRobinsonRhettRobinson Member Posts: 196 ✭✭✭
    image.png

    Here is some code I pieced together (I need to brush up again on my fundamentals) that is giving me what I need. All I really want now is to code in the debug lines as shown in my markup and make the value fill into the name of the feature. Pretty stripped down, but that's all I need it for.

  • MichaelPascoeMichaelPascoe Member Posts: 2,803 PRO

    Ok, to auto name the feature based on your measurements you will need to put this in the header:

    image.png

    And then set that computed parameter in the feature body:

    image.png


    To create a debug line, use this method:

    image.png

    .


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
Sign In or Register to comment.