Tuesday, January 27, 2009

AutoCAD Map 3D: Creating Calculations with Expressions

You can use operators and functions to calculate a new value based on existing property values. You can use the resulting value to filter or select data. For example, you can calculate the area of parcels and then select parcels whose areas are above a certain area value.

In AutoCAD Map 3D, you can store the resulting calculation as a new property in the Data Table. The calculated property is stored with the map, but is not written back to the original data store. To save the property to a data store,export the layer to an SDF file.

The syntax for calculations varies, depending on whether you use operators or functions.

There are two special calculations you can perform: finding the area of a polygon and finding the length of a linear feature.

You must be online and connected to the data store that contains the data for the calculation in order to create or manage calculations.

For some calculations, values do not update automatically because their underlying functions are not supported by their data providers. Instead, the values display as read-only properties. If you do not see a new calculated value immediately, refresh the layer manually. Right-click the layer in Display Managerand click Refresh Layer.

To perform a calculation using an operator

1. Select the command for which you want to create an expression.

2. In the expression area, do one of the following:
■ Enter a property name manually.
■ Click Property. Select the property you want.

3. To insert an operator, do one of the following:
■ Enter an operator for this property manually.
■ Click an operator button.
■ Click Operators. Select the operator you want.

4. Select or enter the value to evaluate.

For example, if you are multiplying the value of the property, enter the number or insert a property to multiply by.

5. Specify any further conditions for the expression.

To create a complex property evaluation, insert an AND or OR operator,and then insert another operator/property combination.

To perform a calculation using a function:

1. Select the command for which you want to create an expression.

2. In the expression area, click one of the following and select a function:
■ Math Function
■ Text Functions
■ Date Functions

3. Click Property and select the property to apply the function to.



4. Click OK to apply the expression.

To find area or length

1. Select the command for which you want to create an expression.

2. In the expression area, enter or insert the geometric function (Area2D or Length2D).

3. Insert the property Geometry in parentheses after the function.

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.

4. Click OK to apply the expression.