Friday, December 11, 2015

How to create bearing labels that show all bearings as north


Article by Timothy Corey




This article is about a way to make Civil 3D display all bearings in their northerly directions. My solution was going to be a process that would involve three expressions and one label style that would include two components. Jeff Mischler, my friend and the Yoda of Civil 3D, showed me a way to do it with one expression and one label style having one component. Jeff's solution, in my words:

Step 1 -- Create a new Expression. This post will show the process using a General Line label style. It could be performed in the same manner for Alignment Line labels or for Parcel Segment labels. Right click and pick New... 





I going to blow this image up large so you can read the expression:



If it were to be translated into English: Take the statement "direction of line line is either smaller than or equal to 90 degrees (0 is north, angles are to the right) or larger than or equal to 270 degrees." If that is true, then return the segment direction, but if the statement is false, return the segment direction plus 180 degrees (in radians, pi.) That makes southerly lines answer with a northerly direction. Slick. Thanks, Jeff.

In case you don't understand what pi is doing in there, general segment direction is returned in radians. Using radians, pi is half of a circle, 180 degrees, or 3.1415926... radians. What you and I think of as AutoCAD 270 degrees is pi*1.5, or 4.712...radians. Using pi instead of the actual radians lets you avoid rounding errors that can only be avoided by typing out the radians to many decimal places. It's far easier to just say pi * 1.5 than 4.7123889. Plus it's easier to remember. That's why you see pi in these formulas.

Be positive that you have set Format result as: to Direction.Your expression won't work if you don't.

Create a new label style. Pick the Bearing component in Component name list.


Go into Contents:






Select inside the preview window and delete the contents, then drop down the Properties list.



Set the settings to your desire, then press the right-pointing arrow that sits just to the right of the Properties list. The Preview window will populate.



Hit OK, set the rest of your label properties and components and go test it.





That's way easier than how I was going to to do it. 












1 comment:

StarLord James said...

How do you apply this to a Curve Label? They do not have the same options