Customer Service | Training | Contact Us
You are here: Home > Downloads > ArcScripts > Search Results > Script Details Login | Feedback | Help

Add x and y to the attribute table of a point or polygon layer modified for ArcGIS 9.x



contact author | download help | add bookmark | view bookmarks
Author Xiaoming Yang
File Name addxy.txt
Language Visual Basic
Last Modified Jan 18 2005
Status of work Public Domain
Software ArcGIS Desktop
File Size 6.9 kb
Downloads 4208

ArcScripts is intended for the free exchange of scripts and tools related to ESRI software products. Please alert the moderator if this script is a demo, trial-version, or an advertisement for a retail product.


Summary
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.