Rounding values in relations
Rounding values in relations
(OP)
I am trying to round a parameter up to either 5 or 10. I am wondering if there is a way to write this into the relations so when this parameter is calculated in the relations it rounds automatically.





RE: Rounding values in relations
Pro/E doesn't have a 'modulo' function in its relations editor, so its necessary to brew your own. It's messy either way.
Let's say your parameter is called "NUM". Relation code for rounding it is as follows:
CODE
TEMP2 = floor(TEMP1)
TEMP3 = TEMP1-TEMP2
IF TEMP3 < 0.5
ROUNDED_NUM = 5*TEMP2
ELSE
ROUNDED_NUM = 5*TEMP2+5
ENDIF
There's probably more efficient ways to do this, though, but it's a solution that has worked well for me in the past.
RE: Rounding values in relations