fbpx
  • autodesk platinum partner
  • Civil 3D – Tip of the Day

    Prem Joseph
    Technical Consultant — INFRA/GIS at SolidCAD  

    Civil 3D Label Styles-Using Expressions

    For every project, we either use out-of-the-box styles or create new styles to meet specific requirements of the company we work for or the project we are working on.

    Once they are included in our template, we have everything covered, right?

    But what if you need to display a property of an object that isn’t available under the Label Style Composer? Or maybe we want to display the label in a different way based on a certain value of the object?

    First, let’s take a quick look at the fundamentals of the Expressions.

    Expressions are located under the Settings tab of the Toolspace, under the Label Styles folder. (See Picture Below)

    The New Component dialogue box consists of a number of components that are used to create the Expression.

    1. In the Name field enter a relevant, identifiable name for your Expression
    2. The Expression field will contain all the formulas and properties as the Expression is developed.
    3. Buttons that may be used to aid in the development of the Expression (you can enter by the keyboard if you prefer)
    4. The available object properties that may be inserted in the Expression field.
    5. Functions that may be used in the development of the Expression
    6. Choose how the results of the Expression are to be formatted. Usually always Double. (Unitless)
    EXAMPLE

    Let’s use an example and create an Expression that will truncate a pipe length label to the nearest 0.50 metre.

    We get this request at times because not everyone wants the accuracy of a pipe length shown to the tenth of a metre.

    To create the Expression right click on the “Expressions” and select New (See Image Down Below)

    here are the STEPS

     

    STEP 1:

    In the dialogue box enter a name and description for the Expression that reflects the resultant label style. (Image 1)

    STEP 2:

    Pick the Formula button to expand the Expression Functions, in our case select the ROUND function (Image 2)

    NOTE:  The image to the right shows an arrow pointing to a button that inserts the ROUND function to the Expression window.

    STEP 3:

    Next we need to add the Object Property by picking the Object the Properties button and picking the appropriate Property.

    In our case we will select 2D Length-Center to Center which is automatically inserted into the Expression window. (See Images Below)

    Now we just need to add a little more math to complete the Expression and then click OK.

     

    STEP 4:

    The new Expression will be displayed in the Preview window of the Toolspace>Settings tab under the Pipe Label Styles and is now available to be applied to a pipe label

    To add the Expression to the Label Style create a New pipe Label by copying and editing an existing style.

     

    STEP 5:

    Copy the default Length Description and Slope label style and rename it Rounded Length and Slope (See Picture Below)

    Then select the Layout tab and in the Text section on the Contents row pick the corresponding cell in the Value column and pick the Ellipse button to access the Text Component Editor. (As seen in the picture below)

    [

    In the preview window of the Component editor highlight the “2D Length…” string and press delete to remove it from the label.

     

    STEP 6:

    In the Properties section pick the down arrow and locate the “Pipe Length to Nearest 0.5m” Expression that was created, set the Precision to 0.1 and click the UPDATE arrow to update the label in the preview window.

    Click OK twice to closer the Component Editor and Label Composer.

    Apply the new pipe label to the pipe object and the center to center length with be rounded to the nearest 0.50m.

     

    [/vc_column_text]
      0 Menu