Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Try the following:
Define the Analysis feature.
Create a partlevel parameter AREA_3PLC of data type STRING.
Create afeature level relation in the analysis feature.
The relation has an internal parameter AREA which holds the REAL value of the measure.
The variable D below controls the number of decimals the new STRING parameter will contain.
Set your text to the parameter AREA_3PLC in your feature (assuming 3 places is desired).
The code below sets the number up as a string which is independent of the rounding settings in Pro/E.
Good Luck
Jason Richards
Engineering Manager
Teleflex Marine
props to Tips from Joe: http://tipsfromjoe.blogspot.com/search/label/Proe
Add the code belowto the relations windowof the Area Measure analysis feature:
/*Code Starts Here*/
X=AREA
D = 3
/* First accurately round theAREAmeasureto 3 Decimals */
X= AREA * 10^D/*shift the decimal place D positions left*/
AFLOOR = FLOOR(AREA,D) *10^D/*round up the shifted value*/
IF X - AFLOOR < 0.5/*subtractfrom the shifted value and test if round up or down*/
X = FLOOR(AREA,D) /*if down*/
ELSE
X = CEIL(AREA,D) /*if up*/
ENDIF
/* Now convert to a string.Pull out the value before the decimal place and generate the value in back */
FRONT= FLOOR(X)
BACK = X-FRONT
/* Use ITOS to convert the integer value to a string value */
IF FRONT==0.0
AREA_3PLC= "0." + ITOS(BACK*10^D) /* To preserve possible leading zero */
ELSE
AREA_3PLC= ITOS(FRONT) + "." + ITOS(BACK*10^D)
ENDIF