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: 

Roundup Pipe lengths in Labels to nearest 6 inch intervals in Civil 3D

7 REPLIES 7
Reply
Message 1 of 8
mzaman29
1341 Views, 7 Replies

Roundup Pipe lengths in Labels to nearest 6 inch intervals in Civil 3D

When labeling pipes in a pipe network; is there a way or expression to roundup the label to 6 inch interval. For example, if I have a pipe length of 2.6 feet, I want to roundup this to 3.0 feet and if I have a pipe length of 2.4 feet, I want to roundup this to 2.5 feet.

If anyone can help me with, I would really appreciate.

Thanks,

 

7 REPLIES 7
Message 2 of 8
ToddRogers-WPM
in reply to: mzaman29

In the label style, I think if you truncate it, it will round it.



Todd Rogers
BIM Manager
Blog | Twitter | LinkedIn

Message 3 of 8
mzaman29
in reply to: ToddRogers-WPM

I already tried truncate but it's not working.
Message 4 of 8
troma
in reply to: mzaman29

Might have to use an expression.

What does truncate do, exactly?

Mark Green

Working on Civil 3D in Canada

Message 5 of 8
ToddRogers-WPM
in reply to: troma

Truncate is supposed to round the numbers.

 

However, here is a blog about creating an expression to round the numbers...

 

http://ontariocivil3d.blogspot.com/2011/02/civil-3d-label-styles-using-expressions.html



Todd Rogers
BIM Manager
Blog | Twitter | LinkedIn

Message 6 of 8
BrianHailey
in reply to: mzaman29

Truncate will drop the decimal, not round it.

 

trunc(1.1)=1.0

trunc(1.9)=1.0

trunc(-1.9)=-1.0

 

Ceiling returns the next highest integer.

 

ceil(1.1)=2.0

ceil(1.9)=2.0

ceil(-1.9)=-1.0

 

Floor returns the next lowest integer.

 

floor(1.1)=1.0

floor(1.9)=1.0

floor(-1.9)=-2.0

 

In your case, you want the next largest half number so your expression will look like this:

CEIL({2D Length - Center to Center}*2)/2

 

1.4 becomes 2.8 becomes 3.0 becomes 1.5

1.6 becomes 3.2 becomes 4.0 becomes 2.0

 

Brian J. Hailey, P.E.



GEI Consultants
My Civil 3D Blog

Message 7 of 8
ToddRogers-WPM
in reply to: mzaman29

Well that's not confusing. Thanks for the clarification in the truncating though.


Todd Rogers
BIM Manager
Blog | Twitter | LinkedIn

Message 8 of 8
BrianHailey
in reply to: BrianHailey

You have to be careful. If you have two labels for the same length, you might end up with some odd results. If the length is 110.04 and you label it out to the tens place with and without the expressions, you'll see:

 

110.0 without the expression

110.5 with the expression

 

If this is important, you can do more in the epxression to account for this.

Brian J. Hailey, P.E.



GEI Consultants
My Civil 3D Blog

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

Post to forums  

Rail Community


Autodesk Design & Make Report