This is a modified version for ArcGIS 9.x.
The program adds x and y coordinates (Centroid or label point) to the selected polygon or point feature layer in an ArcMap data frame. If the field XCOORD or YCOORD does not exist in the layer, the program will add the field to the layer attribute table. The values of the coordinates that are added to the attribute table are in same coordinate and projection as the one sets in the Data Frame Properties. In that case, user can control what coordinate and projection of the x and y should be in the attribute table.
To make the script work on your ArcMAP,
1. Open your ArcMAP document with the data layer loaded and selected;
2. Start VB Editor by clicking Tools|Macros|visual Basic Editor;
3. Load the script addxy2ptpy.txt to the editor by clicking File|Import File... in the VB Editor
4. Close the VB Editor and return to ArcMAP
5. Run the script by clicking Tools|Macros|Macros... then clicking RUN button while Addxy2Att is highlighted.
|