Skip to main content
1-Visitor
April 17, 2018
Question

Model relations – negative values

  • April 17, 2018
  • 4 replies
  • 6709 views

Hello,

I am trying to set up in the relations to accept both negative and positive values but not a zero value. Here is what I have so far.

I have the values, A_X…., defined by a sketch, input1…. With Creo you cannot have a negative value since it just flips the line segment 180 deg also you cannot enter a value of zero for the line segment. Please advise on how to proceed if more information is needed just let me know.

Thanks,

Joe

4 replies

1-Visitor
April 17, 2018

Sorry the input screen did not show up see attachedCapture.PNG

1-Visitor
April 17, 2018

Prefixing the dimension with a "$" will allow it to have a negative value without changing the sense of the dimension/flipping the direction of positive.

 

You need an IF (ELSE) ENDIF statement block if you want to avoid "0" . "ELSE" is optional.

 

Here's an example (not customized for your particular use.)

if $d49:1<2 & increment <>0
direction = 1
endif
1-Visitor
April 17, 2018

If a user enters 0 as the line segment creo will error out and replace with previous value. How do I get around that so the user can enter 0 as the segment length but it corrects and has a value of 0.001?

24-Ruby III
April 17, 2018

Hi,

 

look into attached model (created in CR2 M070).

HamsterNL
18-Opal
April 18, 2018

As others have stated, the $ will allow a parameter to become negative.

 

Creo will not allow:

  • Line segments to become 0
  • Arcs to become 0
  • Pattern quantities to become 0

There might be more, but you will figure those out yourself 🙂

 

Some tips:

  • Use parameters to drive your sketch.
  • Use the MIN and MAX functions

Small example attached

1-Visitor
April 18, 2018

I am trying to make the sketch so the user does not have to use the relations tab. Trying to make it user friendly to those that don't know how to use the relation and also so the relations don't get messed up.

 

Thanks all for the help ill do some more working with this and report back if I find anything out.

16-Pearl
May 9, 2018

So in essence are you doing relations at the sketch level? I've generally avoided those because they are very hard for someone to find if they are not intimately familiar with the model, and can leave the regeneration status permanently yellow.