cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Model relations – negative values

Halgrimson840
3-Newcomer

Model relations – negative values

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

9 REPLIES 9

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

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

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?

Hi,

 

look into attached model (created in CR2 M070).


Martin Hanák

I use the sketch to define the length. I edited you part to reflect what I have set up. If this is backwards im open to suggestions.

Hi,

 

I think that you cannot use dimension as driving value. Instead of it you have to use parameter as driving value. See attached model.


Martin Hanák

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

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.

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.

Dave Martin - dmartin@creowindchill.com - https://www.mcaeconsulting.com
Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags