English

How To: Return the extent of polygon features using the Field Calculator

Summary

You can use the Field Calculator and the ReturnExtent Avenue request to add the extent of polygon features to the theme table.

Procedure

  1. Open the polygon theme table.
  2. Add the following four fields to the table:

    A. Open the table and select Start Editing from the Table menu.
    B. Select Add Field from the Edit menu.
    C. In the Field Definition dialog box:

    1) Set Name to an appropriate name, for example 'Area'.
    2) Set Type to Number.
    3) Set Width to an appropriate number, for example '32'.
    4) Set Decimal Places to the desired number, for example '6'.
    5) Click OK.

    D. Select Stop Editing from the Table menu and save the edits.



    Name  Type   Width  Decimals
    XMIN Number 16 6
    YMIN Number 16 6
    XMAX Number 16 6
    YMAX Number 16 6

  3. Select Start Editing from the Field menu, if not already in edit mode.
  4. Make the XMIN field active.
  5. Select Calculate from the Field menu.
  6. Type the following code in the expression box of the Field Calculator and click OK.

    Code:
    [Shape].ReturnExtent.GetLeft

  7. Repeat steps 4 - 6 using the the expressions below for each field.

    YMIN =

    Code:
    [Shape].ReturnExtent.GetBottom

    XMAX =

    Code:
    [Shape].ReturnExtent.GetRight

    YMAX =

    Code:
    [Shape].ReturnExtent.GetTop

  8. Select Stop Editing from the Table menu.