turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Close

AutoCAD Civil 3D General Discussion

- Autodesk Community
- >
- AutoCAD Civil 3D
- >
- AutoCAD Civil 3D General Discussion
- >
- Re: Need an expression to round Pipe Slopes

Topic Options

- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page

Active Member

8 Posts

0 Kudos

Registered:
03-16-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

433 Views, 12 Replies

10-08-2012 08:43 AM

We Need an expression to round Pipe Slopes to the nearest 0.5% slope.

We were working with:

ROUND(({Pipe Slope}/0.5))*0.5

but it only returns 0.00,

what's missing? THanks

Solved! Go to Solution.

Solved! by Jeff_M. See the answer in context.

tgaf wrote:

yeah, I started with those solutions but they still don't return the desired result.

If the slope of the pipe is -14.73% the (ROUND({Pipe Slope}*2))/2 expression returns 0.00%

If the slope of the pipe is -243.18% then (ROUND({Pipe Slope}*2))/2 expression returns -250.00%

with the (ROUND({Pipe Slope}*10))/10 expression the results are -10.00% and -240.00% resepectively.

hmmm...

thanks for looking at the conundrum..

You are really wanting to round a number such as this: 0.14733689 (14.73%) to this: 0.1475. So this expression does just that: (ROUND({Pipe Slope}*2000)/2000 This gets the decimal point to the place that needs to be rounded.

*Expert Elite*

2,801 Posts

308 Kudos

Registered:
12-18-2002

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2012 10:37 AM in reply to:
tgaf

I've done that with slopes on Section Views. I made two Expressions:

First, to find those values that should round to no decimal places:

IF(ABS({Grade between Point 1 and Point 2})-ABS(TRUNC({Grade between Point 1 and Point 2}))<0.25|ABS({Grade between Point 1 and Point 2})-ABS(TRUNC({Grade between Point 1 and Point 2}))>=0.75,1/120,0)

Note the | symbol between <0.25 and the next ABS means OR.

Second, to find those values that should round to .5:

IF(ABS({Grade between Point 1 and Point 2})-ABS(TRUNC({Grade between Point 1 and Point 2}))>=0.25&ABS({Grade between Point 1 and Point 2})-ABS(TRUNC({Grade between Point 1 and Point 2}))<0.75,1/120,0)

You might need to play with the 1/120 text height to get a height that works for you.

I assume you know how to make your label style use these. If not, let me know.

Tim

Tim Corey, Owner

Delta Engineering Systems

Redding, CA

Autodesk Authorized Value-Added Reseller

Delta Engineering Systems

Redding, CA

Autodesk Authorized Value-Added Reseller

Active Member

8 Posts

0 Kudos

Registered:
03-16-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2012 11:45 AM in reply to:
tcorey

Thanks for the quick response, I'm trying to add the expression to a pipe label style, need to round out the pipe's slope. Not sure how the "Grade between Point 1 and Point 2" plays out.

Why does picking the "Pipe Slope" function not play out?

THanks,

*Expert Elite*

2,801 Posts

308 Kudos

Registered:
12-18-2002

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2012 01:28 PM in reply to:
tgaf

Look in the attached drawing. Find on Settings tab of Toolspace: Pipes --> Label Styles --> Plan/Profile --> Expressions.

These are referenced by the label style called Pipe slope - percent - rounded to .5. Apply that to your pipes and they will round to either no decimal places or .5.

Best regards,

Tim

Tim Corey, Owner

Delta Engineering Systems

Redding, CA

Autodesk Authorized Value-Added Reseller

Delta Engineering Systems

Redding, CA

Autodesk Authorized Value-Added Reseller

Active Member

8 Posts

0 Kudos

Registered:
03-16-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2012 02:39 PM in reply to:
tcorey

WOw, that's interesting, thanks , but unfortunately I'm dealing with 2012 and that percent function doesn't exist in the 2012 release, or I may be missing something. Thanks for the file though, just another reason to upgrade.

*Expert Elite*

2,801 Posts

308 Kudos

Registered:
12-18-2002

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2012 03:23 PM in reply to:
tgaf

Here's a 2012 version.

Tim Corey, Owner

Delta Engineering Systems

Redding, CA

Autodesk Authorized Value-Added Reseller

Delta Engineering Systems

Redding, CA

Autodesk Authorized Value-Added Reseller

Active Member

8 Posts

0 Kudos

Registered:
03-16-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-09-2012 07:10 AM in reply to:
tcorey

Thanks again for the 2012 version, but i think I'm not explaining myself correctly, I need to be able to round the slope percentage in the lable so that if the slope of the pipe is 3.42 as an example it will round down to 3.40, or if it is 7.47 it will round up to 7.50. The options of round normal , truncate and round up in the component editor don't seem to do the trick.

Thanks for your effort.

*Expert Elite*

2,801 Posts

308 Kudos

Registered:
12-18-2002

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-09-2012 09:25 AM in reply to:
tgaf

Sounds to me like you're rounding to the nearest tenth, which Civil 3D does without expressions. Your original post stated you want to round to the nearest .5, which is what the expressions I built do.

Maybe you can post a drawing with detailed description of what you want and that Civil 3D doesn't appear to be doing for you.

Tim

Tim Corey, Owner

Delta Engineering Systems

Redding, CA

Autodesk Authorized Value-Added Reseller

Delta Engineering Systems

Redding, CA

Autodesk Authorized Value-Added Reseller

Active Member

8 Posts

0 Kudos

Registered:
03-16-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-09-2012 10:58 AM in reply to:
tcorey

okay, here's a dwg with a few pipe examples,

so basically to illustrate, if the slope is 4.54% so to say, we need it to read 4.55%,

if its let's say -3.32%, then we need it to read -3.30%

if 5.58%, we need it to read 5.60%

can't seem to get it to work with the given rounding methods

again, thanks for your efforts

*Expert Elite*

2,609 Posts

54 Kudos

Registered:
10-13-2005

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-09-2012 08:54 PM in reply to:
tgaf

Sounds like you are looking to round to the nearest tenth, but show two digits. This expresion should do it:

(ROUND({Pipe Slope}*10))/10

If you want the nearest 0.5% then this expression should work:

(ROUND({Pipe Slope}*2))/2

Christopher

http://blog.civil3dreminders.com/

Civil Reminders

http://blog.civil3dreminders.com/

http://www.CivilReminders.com/

http://blog.civil3dreminders.com/

http://www.CivilReminders.com/

Search This Board

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Post to the Community

Have questions about Autodesk products? Ask the community.

The Knowledge Network

Access a broad range of knowledge to help get the most out of your products and services.

Download & Installation

Getting your Software

Downloads & Upgrades

Serial Numbers & Product Keys

Installation & Licensing

Activation & Registration

Network License Administration

Subscription Management

Sign In / Create Account

Maintenance Subscription Help

Desktop Subscription Help

Cloud Service Subscription FAQ

Announcements

Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!

- Privacy | Legal Notices & Trademarks | Report Noncompliance | Site map | © Copyright 2014 Autodesk Inc. All rights reserved

Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Please see the Autodesk Creative Commons FAQ for more information.