|
[Sponsors] |
January 22, 2013, 11:15 |
Rounding Values in Post
|
#1 |
New Member
Join Date: Jan 2013
Posts: 4
Rep Power: 13 |
Hi Everybody,
I'm trying to get the length of my geometry with the following expressions: TEXT: X Abmass Colour = 0, 0, 0 Font = Sans Serif Position Mode = Three Coords Text Colour Mode = Default Text Height = 0.024 Text Position = (maxVal(X)@domair + minVal(X)@domair)/2, maxVal(Y)@domair + 2 [m], maxVal(Z)@domair Text Rotation = 0 [degree] Visibility = On X Justification = Center Y Justification = None TEXT ITEM: Text Item 1 Auto Annotation Expression = (maxVal(X)@domair - minVal(X)@domair) Auto Annotation File Date Format = DD/MM/YY Auto Annotation File Time Format = h:m:s t Auto Annotation Filename Format = Filename Only Auto Annotation Type = Expression Embed Auto Annotation = On Text Item Active = On Text String = <aa> END END Unfortunately "(maxVal(X)@domair - minVal(X)@domair)" gives "33.7966 [m]" Does anyone know how I can have it rounded to two digits? And if that's possible: to remove the units? Thanks |
|
January 22, 2013, 16:39 |
|
#2 | |
Senior Member
Join Date: Dec 2009
Posts: 131
Rep Power: 19 |
Off the top of my head not sure how to do that in an expression or CEL, but the Power Syntax can easily do it.
Create a session file 2 perl lines Code:
! ($extent, $extent_units) = maxVal("X","DEF") - minVal("X", "DEF"); ! $extent = sprintf "%.2f", $extent; On the line Auto Annotation Expression make it Auto Annotation Expression = $extent Example: Code:
! ($extent, $extent_units) = maxVal("X","DEF") - minVal("X", "DEF"); ! $extent = sprintf "%.2f", $extent; TEXT:Text 1 Colour = 0, 0, 0 Font = Sans Serif Position Mode = Two Coords Text Colour Mode = Default Text Height = 0.024 Text Position = 0 , 0.96 Text Rotation = 0 [degree] X Justification = Center Y Justification = None TEXT ITEM:Text Item 1 Auto Annotation Expression = $extent Auto Annotation File Date Format = DD/MM/YY Auto Annotation File Time Format = h:m:s t Auto Annotation Filename Format = Filename Only Auto Annotation Type = Expression Embed Auto Annotation = On Text Item Active = On Text String = Expression = <aa> END END Quote:
|
||
January 23, 2013, 03:32 |
|
#3 |
New Member
Join Date: Jan 2013
Posts: 4
Rep Power: 13 |
Hi mjgraf
That work perfectly! Thanks for the quick reply! |
|
January 23, 2013, 11:21 |
|
#4 |
New Member
Join Date: Jan 2013
Posts: 4
Rep Power: 13 |
HI again :-)
I have a new problem with probably a similar solution... (something in perl :-)) I would like to have my text position automated Text Position = (maxVal(X)@domair + minVal(X)@domair)/2, maxVal(Y)@domair + 2 [m], maxVal(Z)@domair is not good enough... Is it possible that the text is right alined to the text position? And is it possible that the distance to the text position is constant (when changing the camera position in Post)? Cheers |
|
March 5, 2014, 09:10 |
|
#5 |
New Member
Zvika
Join Date: Mar 2009
Posts: 2
Rep Power: 0 |
You can use int() and nint() CEL functions
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
strange node values @ solid/fluid interface - help | JB | FLUENT | 2 | November 1, 2008 13:04 |
node values or cell values? | aPpA | FLUENT | 0 | November 10, 2006 09:56 |
Plotting raw data values | Wilesco | Siemens | 0 | January 5, 2006 06:34 |
post processing CL values | Joe Bryant | FLUENT | 2 | October 18, 2004 05:17 |
Post Processing | Koorosh MOHAMMADI | FLUENT | 1 | June 13, 2002 07:54 |