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: 

USING AN EXPRESSION IN A SLOPE LABEL

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Dixter
2332 Views, 4 Replies

USING AN EXPRESSION IN A SLOPE LABEL

I am trying to add a custom surface label to a drawing. The Label will be used to calculate an ‘LS’ value between two points on a surface. The ‘LS’ value is dependant on two pieces of input information: Surface Slope Distance, and Surface Slope (%).  I am using standard surface labels {Surface Slope Distance} and {Surface Slope} in the drawings currently, and they are working fine with no problems. The problem comes when I try to create the 3rd custom label to calculate the ‘LS’ value using the values of the standard {Surface Slope Distance} and {Surface Slope} labels.

 

The ‘LS’ Calculation is a fairly complicated formula which varies depending on the % Surface Slope; Here is the formula for each slope range:

 

0.00% < Surface Slope <= 1.00% :

 

‘LS’ = 0.03 + 10.8*[(Surface Slope Length / 22.13)^0.2] *[SIN(ATAN(Surface Slope)]

 

1.00%< Surface Slope <= 3.00%:

 

‘LS’ = 0.03 + 10.8*[(Surface Slope Length / 22.13)^0.3] *[SIN(ATAN(Surface Slope)]

 

3.00%< Surface Slope <= 5.00%:

 

‘LS’ = 0.03 + 10.8*[(Surface Slope Length / 22.13)^0.4] *[SIN(ATAN(Surface Slope)]

 

5.00%< Surface Slope <= 9.00%:

 

‘LS’ = 0.03 + 10.8*[(Surface Slope Length / 22.13)^0.5] *[SIN(ATAN(Surface Slope)]

 

Surface Slope > 9.00%

 

‘LS’ = 10.8*[(Surface Slope Length / 22.13)^0.5] *[(SIN(ATAN(Surface Slope))/22.13]^0.6

 

The label that I am trying to make will show an arrow in the direction of flow (higher elevation to lower) between two points, showing:

 

i) Surface Slope (%)

ii) Surface Slope Length (m)

iii) Calculated ‘LS’ Value

 

I have created an expression in Surface Slope Labels containing the above formula using an IF statement. The formula seems to work accurately 90% of the time, but I am noticing deviation in the output when:

 

- the Surface Slope Length values are small (<~25m),

- the Surface Slopes are high (>~3.00%)

 

 

The strangest issue I have been having is that the label gives different output values when the arrows are drawn in opposite directions between the same two points. Ie: When drawn from point A to B the ‘LS’ Value may be 0.28, however when drawn from the same Point B to A the ‘LS’ Value is0.26. At first I thought this could have been due to the slopes being read into the formula as +’ve or –‘ve causing the errors. I changed my code to take the absolute value by using the following if statement:

 

SIN(ATAN(IF({Surface Slope}>0,{Surface Slope},-1*{Surface Slope})))

 

However, the output is still different between the same two points in different directions.

 

If anyone is able to offer any suggestions at all please let me know. I have copied my code down below. Thanks very much in advance to anyone with any suggestions!

 

IF(0.00<{Surface Slope}<=0.01, 0.03+((({Surface Slope Distance}/22.13)^0.2)*SIN(ATAN(IF({Surface Slope}>0,{Surface Slope},-1*{Surface Slope})))*10.8), IF({Surface Slope}<=0.03, 0.03+((({Surface Slope Distance}/22.13)^0.3)*SIN(ATAN(IF({Surface Slope}>0,{Surface Slope},-1*{Surface Slope})))*10.8),IF({Surface Slope}<=0.05, 0.03+((({Surface Slope Distance}/22.13)^0.4)*SIN(ATAN(IF({Surface Slope}>0,{Surface Slope},-1*{Surface Slope})))*10.8),IF({Surface Slope}<=0.09, 0.03+((({Surface Slope Distance}/22.13)^0.5)*SIN(ATAN(IF({Surface Slope}>0,1*{Surface Slope},-1*{Surface Slope})))*10.8),IF(1.0>{Surface Slope}>0.09, ((({Surface Slope Distance}/22.13)^0.5)*(SIN(ATAN(IF({Surface Slope}>0,1*{Surface Slope},-1*{Surface Slope})))/0.0896)^0.6),0)))))

 

 

Dixter
4 REPLIES 4
Message 2 of 5
Civil3DReminders
in reply to: Dixter

Getting the absolute value for the slope this way seems to work correctly:

 

IF(0.00<ABS({Surface Slope})<=0.01,0.03+((({Surface Slope Distance}/22.13)^0.2)*SIN(ATAN(IF(ABS({Surface Slope})>0,ABS({Surface Slope}),-1*ABS({Surface Slope}))))*10.8), IF(ABS({Surface Slope})<=0.03, 0.03+((({Surface Slope Distance}/22.13)^0.3)*SIN(ATAN(IF(ABS({Surface Slope})>0,ABS({Surface Slope}),-1*ABS({Surface Slope}))))*10.8),IF(ABS({Surface Slope})<=0.05, 0.03+((({Surface Slope Distance}/22.13)^0.4)*SIN(ATAN(IF(ABS({Surface Slope})>0,ABS({Surface Slope}),-1*ABS({Surface Slope}))))*10.8),IF(ABS({Surface Slope})<=0.09, 0.03+((({Surface Slope Distance}/22.13)^0.5)*SIN(ATAN(IF(ABS({Surface Slope})>0,1*ABS({Surface Slope}),-1*ABS({Surface Slope}))))*10.8),IF(1.0>ABS({Surface Slope})>0.09, ((({Surface Slope Distance}/22.13)^0.5)*(SIN(ATAN(IF(ABS({Surface Slope})>0,1*ABS({Surface Slope}),-1*ABS({Surface Slope}))))/0.0896)^0.6),0)))))

Message 3 of 5
Dixter
in reply to: Dixter

Thanks for getting back to me so quickly. I am now using the ABS function, and everything is working fine.

 

It turns out that I didn’t need to use the ABS function in an IF statement. For example in:

 

SIN(ATAN((IF(ABS({Surface Slope})>0,ABS({Surface Slope}),-1*ABS({Surface Slope})))

 

The ABS({Surface Slope}) will always return a value greater than zero, so the statement isn’t really needed. I found that I just needed to use SIN(ATAN(ABS({Surface Slope})) to get the same result.

 

I think that the error in my original code was in the beginning of each of my statements in not taking the ABS value of the Surface Slope when testing it against the 5 different ranges of potential slope values for the formula(s).  i.e. IF(0.00<ABS({Surface Slope})<=0.01, ….. instead of IF(0.00<{Surface Slope}<=1.00,….

 

Thanks again for pointing out the ABS function and for your insight with this. I didn’t know the ABS function could be used in the Expressions tool as it wasn’t one of the functions listed on the drop-down menu along with IF, SIN, ATAN, etc.

 

I’ve posted the working code below that I am now using if anyone else is interested.  

 

IF(0.00<ABS({Surface Slope})<=0.01,0.03+((({Surface Slope Distance}/22.13)^0.2)*SIN(ATAN(ABS({Surface Slope})))*10.8),

IF(ABS({Surface Slope})<=0.03, 0.03+((({Surface Slope Distance}/22.13)^0.3)*SIN(ATAN(ABS({Surface Slope})))*10.8),

IF(ABS({Surface Slope})<=0.05, 0.03+((({Surface Slope Distance}/22.13)^0.4)*SIN(ATAN(ABS({Surface Slope})))*10.8),

IF(ABS({Surface Slope})<=0.09, 0.03+((({Surface Slope Distance}/22.13)^0.5)*SIN(ATAN(ABS({Surface Slope})))*10.8),

IF(1.0>ABS({Surface Slope})>0.09, (({Surface Slope Distance}/22.13)^0.5)*(SIN(ATAN(ABS({Surface Slope})))/0.0896)^0.6,0)))))

Dixter
Message 4 of 5
onsionsi1
in reply to: Dixter

What do you mean by (LS) Mr. kdixon

 

Thank you.

Please do not forget approve as solutions and Points
to Remember Please Accept as Solution and Kudos Please
Message 5 of 5
Dixter
in reply to: Dixter

I'm sorry, this issue was solved some time ago. I have changed the status in the discussion group.

The LS Formula is used to calculate soil loss, which we use in our Erosion Control Reports.

L is the slope length factor, representing the effect of slope length on erosion.
S is the slope steepness, representing the effect of slope steepness on erosion.

We have incorporated this Formula into an expression which we use in a slope label that displays the Length, Slope and resulting LS factor.

Kirk R. Dixon, C.E.T.
Associate / Project Technologist
[cid:image002.png@01CE321D.FF38DC80]Centre Eight Ten * Suite 110 * 7777 - 10th Street NE * Calgary, Alberta * T2E 8X2
Tel: 403.247.2001 (ext. 1123) * Fax: 403.247.2013 * Cel: 403.701.2010 * kdixon@bsei.ca * www.bsei.ca
P Please consider your environmental responsibility before printing any e-mail
Dixter

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

Post to forums  

Rail Community


Autodesk Design & Make Report