Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

rounding in Expression

10 REPLIES 10
Reply
Message 1 of 11
Joe-Bouza
1136 Views, 10 Replies

rounding in Expression

How can I evaluate and expresion to the nearest tenth?

 

 

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
10 REPLIES 10
Message 2 of 11
jmayo-EE
in reply to: Joe-Bouza

Never did this but the list of available functions says to wrap your math in this, ROUND(x).

 

http://docs.autodesk.com/CIV3D/2012/ENU/filesCUG/GUID-448A4BEC-C1D1-404F-83B5-0C0E3B46ABB-2156.htm

John Mayo

EESignature

Message 3 of 11
BrianHailey
in reply to: Joe-Bouza

The rounding functions are listed along with the rest of the math functions in the expression dialog box. 

 

http://screencast.com/t/eiwAQhfa

 

 

Brian J. Hailey, P.E.



GEI Consultants
My Civil 3D Blog

Message 4 of 11
fcernst
in reply to: Joe-Bouza

CEIL(X/0.1) *0.1


Fred Ernst, PE
C3D 2024
Ernst Engineering
www.ernstengineering.com
Message 5 of 11
fcernst
in reply to: fcernst

CEIL rounds up, FLOOR rounds down

 

Try:

 

ROUND(X/0.1) *0.1



Fred Ernst, PE
C3D 2024
Ernst Engineering
www.ernstengineering.com
Message 6 of 11
BrianHailey
in reply to: Joe-Bouza

Out of curiosity, why don't you just use the label properties to round it? I'm sure there are reasons but I just gotta know.

 

And Freds second post would be the way to do it.

Brian J. Hailey, P.E.



GEI Consultants
My Civil 3D Blog

Message 7 of 11
Joe-Bouza
in reply to: fcernst

I don't mean to sound flippant, but isn't an integer a whole number? I want to deal with the decimal portion.

 

integer.PNG

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
Message 8 of 11
fcernst
in reply to: Joe-Bouza

The math takes care of it :

 

Capture.JPG



Fred Ernst, PE
C3D 2024
Ernst Engineering
www.ernstengineering.com
Message 9 of 11
Joe-Bouza
in reply to: BrianHailey

Yes, I'm sure you do. Smiley Tongue

 

This goes back to the earlier thread where the user wanted to label low points in plan and I suggested doing it with alignment labels that use the profile geometry. I can get the low point and high point labeled,  I added a third element; the driveway elevation for top and bottom of curb.

 

I have a road rehab job where I profiled the gutter at a min 0.30% up and down and across the driveway aprons.

 

I created 3 label components LowPoint, HighPoint, DriveWay:

 

Lowpoint text height says IF({Grade In}-{Grade Out}<0 ,0.008,0)... If the Algebraic difference is neg I should see LP {profile elevation} and the other two labels go to zero

 

Highpoint text height  says IF({Grade In}-{Grade Out}>0,0.008,0)... If the algebraic difference is pos I should see HP {profile elevation} and the other two labels go to zero

 

Driveway text height says IF({Grade In}-{Grade Out}=0,0.008,0)..If the algebraic difference = 0 (on grade) I should see a multiline label

TC{profile elevation + [expression that adds 0.12 to profile elevation}

BC{profile elevation, and the other two labels go to zero

 

I'm not getting the driveway labels. They are coming in as LP{elev} and HP{elev}.

 

So my thought was when I inserted the PVI on grade even though it displays 0.30% the expression may be see 0.299999999902? I'm guessing.

 

Do you see a flaw in my logic(opened myself up for all kinds of comments there)? I know I could use surface label styles but that would mean I'd have to have a surface. I'm only replacing the C&G so I was not thinking corridor.

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
Message 10 of 11
BrianHailey
in reply to: Joe-Bouza

I'm not exactly sure I follow but I think I do.

 

In one situation I had, I wanted the label to be green if the slope was greater than 2.0%. The problem I ran into was if the label was 1.99% the label would still display as 2.0% but wouldn't be green. So what I did was to change the expression. Instead of testing to see if the slope was 2% or greater, I tested to see if it was 1.95% or greate (which is the lower limit of numbers that round to 2%).

 

So when you say your "road needs to be 3.0% or greater" what you are really saying is you "road needs to be a number that rounds to 3.0% or greater".

 

Make sense?

 

Attached is a file with said label style in it. It's from a lab I taught at AU 2008.

 

 

Brian J. Hailey, P.E.



GEI Consultants
My Civil 3D Blog

Message 11 of 11
Joe-Bouza
in reply to: BrianHailey

I though I could hide labels similar to the method for cut and fill tics.

 

this might explain what I am trying to get. Sorry our system will not let me DL your dwg to examine. could you email it? jbouza<at>cameronengineering<dot><com>

 

tcbclphp.PNG

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report