To Create Expressions

To create an expression

  1. Select the feature classes or feature layers to apply the expression to and the action the query will affect.

    For example, in the AutoCAD Map 3D toolset Display Manager, right-click the layer, and click Query To Filter Data. The layer you right-clicked is the data source for the expression. When you filter the data, AutoCAD Map 3D toolset displays only the data in that layer that matches the conditions of the expression.

  2. In the window that displays, insert the elements that comprise the expression.

    If the expression startup page is turned on, buttons representing different expression types are displayed. You can click one of these buttons to insert an expression template.

    Click one of these buttons to start with a sample expression.

    To prevent these startup buttons from displaying each time you create an expression, select the Don’t Show At Startup check box. You can redisplay them later by clicking Getting Started.

    To close the startup page, click Close.

  3. In the expression area, do any of the following to build your expression:
    • Click an element in the expression to replace it with a property, value, or operator. See Choosing Property Values from a List for information on viewing and selecting properties.

      Click an element to see a menu of options for replacing or deleting it.

    • Use commands and icons to add elements.

      Use the menus and buttons at the top of the window to insert elements.

    • If you know the names of the properties, values, and operators you want, enter them directly.

      All expressions consist of text you can type.

    An expression can combine operations in many ways. For example, you can calculate the area of all parcels and then find features that have the StreetName “Elm” and are larger than 20,000 square feet.

  4. In building your expression, you can do any of the following:
    • Evaluate the value of a property. For example, find features on a Parcels layer whose StreetName property is “Elm.” That expression would look like this one:

      ST_NAME = 'ELM St'

    • Perform a calculation, and then evaluate the result of the calculation. For example, first determine the area of parcels, and then find parcels with an area smaller than a value you specify. That expression would look like this one:

      Area2D (Geometry) < 12000

      Note:

      The Geometry property may have a different name in your data store. It is always listed under Geometry Properties in the Property list. Insert the property from the list. Do not change it manually or substitute a value for this property.

    • Perform a conversion, and then evaluate the result of the conversion. For example, convert a parcel property called Purchase_Date from a text string to a date string, and then find parcels purchased before a date you specify. That expression would look like this one:

      ToDate (PURCHASE_DATE, MM/DD/YYYY) AND PURCHASE_DATE < 01/01/2005

    • Create a text expression. For example, you can label a layer representing roads with the street name, a space, and a suffix (for example, “Portobello Road” or “Fifth Avenue”). That expression would look like this one:

      Concat (ST_NAME, ‘ ‘, SUFFIX)

    • Create a numeric expression. For example, you can round off repair costs to the next highest dollar. That expression would look like this one:

      Ceil (REPAIR_COST)

    • Filter by location. For example, you can find all parcels within or touching a circle that you draw on the map.

    For help with any expression element, see Creating Expressions - Reference.

  5. Validate the expression by clicking Validate (at the bottom of the window).

    Validation checks the syntax of the expression only. It does not check whether the values you specified are valid for the data, or whether the results are as expected. If there are validation problems, an error message helps direct you to their solutions.

  6. To reuse your expression later, save it using the Options menu (at the bottom of the window).
  7. To apply your expression, click OK.
  8. To set expression options, use the Options menu.