Civil 3D: Dynamically Spaced Line Labels

November 16, 2021 Leo Lavayen

A while back a client requested a line bearing and distance label that would automatically adjust to the length of the line.  Below are some examples of a double component (bearing and distance) labels:

  1. TOP: Centered, with inside bottom right and bottom left as attachment points.
  2. MIDDLE: Dynamically spaced, with inside bottom right and bottom left as attachment points
  3. BOTTOM: On endpoints, with outside  bottom left and bottom right as attachment points.

There are many ways of achieving the look of the middle label (#2 shown), as is the case with most AutoCAD tasks.  Here two (2) expressions were created to shift positive (right) and negative (left).  They are then used to slide the Bearing and Distance annotations.

 

The Expressions:

Simple mathematical expression with a spin.  The Overall Length value of line is divided by a user-dictated value, in this case 1/6th of the total line length was used.  There is a special trick, because Civil 3D will want to scale the distance up by the drawing scale, the initial calculation will have to be divided by the Drawing Scale Conversion factor.

Positive Offset:  

The created Expression is the “length/6” then shrunk by the scale factor

 

Negative Offset:

The created Expression is the “length/6” then shrunk by the scale factor, and multiplied by -1

 

The Labels

The created expressions are then applied to the label components to cause the dynamic sliding of the annotations:

BEARING:  the connection point is the default middle of the line, then attached by the Bottom right, with an X Offset shift that used the Spacer Neg value (shift left).

DISTANCE: the connection point is the default middle of the line, then attached by the Bottom left, with an X Offset shift that used the Spacer value (shift right).

 

The simple goal of a line label that automatically spaces itself to 1/6 of the total line length is achieved.

About the Author

Leo Lavayen

Civil Applications Expert<br><br>As an Applications Expert, Leo is responsible for supporting, training and implementation of software for survey and civil engineering professionals. He has more than 17 years of experience helping large and small, public and private clients in the eastern United States.

More Content by Leo Lavayen
Previous Article
Civil 3D: Masked Iron Pins in Line Labels
Civil 3D: Masked Iron Pins in Line Labels

Using curved wipeouts in blocks to hide elements behind a block in AutoCAD or Civil 3D.

Next Article
The "New Normal" - October 2021 Edition
The "New Normal" - October 2021 Edition

One year ago, I posted about the evolving impact that the pandemic was having on the infrastructure design ...

×

Sign up for email updates

First Name
Last Name
Country
Thank you!
Error - something went wrong!