I just tested successfully a new idea for showing two-digit elevations (04.56 instead of 1204.56 or 4.56) (2014 update: I have corrected it to also show 1204.9999 as 05.00 instead of 04.00):
1. Under Toolspace, Settings, Surface, Label Styles, Spot Elevation, Expressions add an expression named "Surface Elevation hundreds" ROUND({Surface Elevation}*100)/10000
2. Under Toolspace, Settings, Surface, Label Styles, Spot Elevation, <your style>, Edit, Layout tab, enter this where you want the two-digit elevation:
This is the code that needs to end up in the right pane of the Label Text Component Editor:
<[Surface Elevation hundreds(P2|RT|AP|GC|UN|Sn|ORD)]><[Surface Elevation(Uft|P2|RN|AP|GC|UN|Sn|ODS)]><[Surface Elevation(Uft|P2|RN|AP|GC|UN|Sn|ORD)]>
In human language, the above adds the elevation in three pieces. For the elevation 1204.56, it adds 1) the "04" from 12.04, 2) the "." from 1204.56, and the "56" from 1204.56.
Explanation for elevation 1204.5588:
Code | Result | Explanation |
---|---|---|
<[Surface Elevation hundreds(P2|RT|AP|GC|UN|Sn|ORD)]> | 04 | ROUND(1204.5588*100)/10000 = 12.0456. Truncate it to two decimal places => 12.04. Output what's right of the decimal => 04. |
<[Surface Elevation(Uft|P2|RN|AP|GC|UN|Sn|ODS)]> | . | Output the decimal sign from the surface elevation => "." (in American English) |
<[Surface Elevation(Uft|P2|RN|AP|GC|UN|Sn|ORD)]> | 56 | Output the part of Surface Elevation right of the decimal => 56 |
Explanation for elevation 1204.9999:
Code | Result | Explanation |
---|---|---|
<[Surface Elevation hundreds(P2|RT|AP|GC|UN|Sn|ORD)]> | 05 | ROUND(1204.9999*100)/10000 = 12.05. Truncate it to two decimal places => 12.05. Output what's right of the decimal => 04. |
<[Surface Elevation(Uft|P2|RN|AP|GC|UN|Sn|ODS)]> | . | Output the decimal sign from the surface elevation => "." (in American English) |
<[Surface Elevation(Uft|P2|RN|AP|GC|UN|Sn|ORD)]> | 00 | Round the Surface Elevation normally and output the part right of the decimal => 00 |
I would LOVE to do Civil 3D consulting work for any of you at any time. And I am happy to share with you my template styles.
12 comments:
I'm having a problem when you add 0.5' to the Pavement or Gutter elevation. How do i incorporate Gutter +0.50' = TC and then {surface elevation} /100?
What I do is create two expressions for each offset elevation label I need. Like this:
A. EXPRESSIONS
1. Surface Elevation
a) Surface Elevation: the original Civil 3D surface elevation
b) Surface Elevation hundreds: {Surface Elevation}/100
2. Up 0.67
a) 0.67 up: {Surface Elevation} + 0.67
b) 0.67 up hundreds: {0.67 up}/100
B. LABEL TEXT
1. On surface: <[Surface Elevation hundreds(P2|RN|AP|GC|UN|Sn|ORD)]><[Surface Elevation(Uft|P2|RN|AP|GC|UN|Sn|ODS)]><[Surface Elevation(Uft|P2|RN|AP|GC|UN|Sn|ORD)]>
0.67 up
<[0.67 up hundreds(P2|RN|AP|GC|UN|Sn|ORD)]><[0.67 up(Uft|P2|RN|AP|GC|UN|Sn|ODS)]><[0.67 up(Uft|P2|RN|AP|GC|UN|Sn|ORD)]>
I tried the Surface Elevation you showed. It worked, but not when it is 1212.9995 is the original elevation.
I tried Truncate, and it didn't show 13.00. I tried round normal, and all of my elevation turned to 13.XX instead of 12.XX on all elevation 1212.5X and above.
Thank you very much for the alert. I have revised step 1. Please let me know how it works for you.
Thank you for the great post!
Hi
I try to display Point Elevation 1234.56 to 34.56 but not work for me.
Please help me
Thanks
Where are you stuck? What can you do?
Thanks
I add all point to drawing C3D 2015 , I will to Display label of Elevation Point 2 decimal of left point for Exp:1023.65 to 23.65
your example foe surface not work for point
You should be able to use the same general approach for Point labels. But you will need to access the Point label styles differently than you access the Spot Elevation label styles. I believe you will need to (want to) manage Point styles through Point Group Styles. You will be happiest in the long run doing that.
Good day Tom.
Thank you very much for this explanation. I use it all the time.
I am wondering if you could do the same for us for Pipe Invert elevations.
I am trying to truncate these elevations in a structure label style but I can't get it to work in a rush...
Blessings!
Elias
Good day Tom:
If I want to round and truncate to the nearest tenth, what adjustments would the expression, or label style contents need?
TY
Elias, I apologize for missing your comments a year ago. Get with me if you still need any help.
Post a Comment