<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding XY Fields to an Attribute Table in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114704#M6533</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can i also use compute geometry for that? for each field (x,y )separate? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Jan 2015 02:48:21 GMT</pubDate>
    <dc:creator>KONPETROV</dc:creator>
    <dc:date>2015-01-17T02:48:21Z</dc:date>
    <item>
      <title>Adding XY Fields to an Attribute Table</title>
      <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114698#M6527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello i have a point.shapefile with fields: FID:0123..., Shape:Points, CONTOUR:400, 401 etc, X, Y. I want to add x,y coordinates to attribute table from a mosaic, how can i do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried from field calculator the following script for X and Y fields at 'show codeblock':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim dblX As Double&lt;/P&gt;&lt;P&gt;Dim pPoint As IPoint&lt;/P&gt;&lt;P&gt;Set pPoint = [Shape]&lt;/P&gt;&lt;P&gt;dblX = pPoint.X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X=&lt;/P&gt;&lt;P&gt;dblX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i have always an error 999999. I am using ArcGis 10.2.2. any suggestion?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 13:57:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114698#M6527</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2015-01-16T13:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Fields to an Attribute Table</title>
      <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114699#M6528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Konstantinos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a Geoprocessing tool that will do this for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000032000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000032000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 14:10:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114699#M6528</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-01-16T14:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Fields to an Attribute Table</title>
      <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114700#M6529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Jake mentioned there are numerous different Geoprocessing tools that will do this depending on your own unique conditions....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried the most simple direct way?&amp;nbsp; Right click on the field you want to populate on your attribute table and choose calculate geometry?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="CalcGeometry.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/51782_CalcGeometry.png" style="height: auto;" /&gt;&lt;IMG alt="c.png" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/51783_c.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 15:17:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114700#M6529</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2015-01-16T15:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Fields to an Attribute Table</title>
      <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114701#M6530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code you provide above is from the &lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=751&amp;amp;pid=746&amp;amp;topicname=Making%20field%20calculations&amp;amp;"&gt;Making Field Calculations &lt;/A&gt;help from ArcGIS 9.3/9.3.1, and therein lies your problem.&amp;nbsp; The code Esri provided was VB/VBA and involved accessing ArcObjects.&amp;nbsp; Starting with ArcGIS 10.0, Esri moved to a VBScript parser instead of a fuller-featured VB/VBA.&amp;nbsp; Although some VB code still works in the code block for the field calculator, the specific code you used doesn't because you can't acess ArcObjects through VBScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if the code you posted worked, VB support has been on life support for a long time, and you should really consider moving to Python.&amp;nbsp; If you simply change the parser to Python, the following code will work in the expression box (you don't need a code block): &lt;SPAN style="color: #3334ca; font-family: courier new,courier;"&gt;!shape.extent.XMax! . &lt;/SPAN&gt;Since it seems you are working with points, and single points at that, the extent of the geometry will be the geometry itself.&amp;nbsp; You could also use &lt;SPAN style="color: #3334ca; font-family: courier new,courier;"&gt;!shape.firstPoint.X!&lt;/SPAN&gt; as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 17:46:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114701#M6530</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-01-16T17:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Fields to an Attribute Table</title>
      <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114702#M6531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you very much sir, it helped me a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 18:08:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114702#M6531</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2015-01-16T18:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Fields to an Attribute Table</title>
      <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114703#M6532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also do it automatically with Python as I showed in this post: &lt;A href="https://community.esri.com/message/447244"&gt;Automatic X and Y in Attribute Table&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 18:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114703#M6532</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-16T18:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Fields to an Attribute Table</title>
      <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114704#M6533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can i also use compute geometry for that? for each field (x,y )separate? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2015 02:48:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114704#M6533</guid>
      <dc:creator>KONPETROV</dc:creator>
      <dc:date>2015-01-17T02:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Fields to an Attribute Table</title>
      <link>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114705#M6534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure to which answer you are replying:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Jake showed you a tool that in a single run will add the fields POINT_X and POINT_Y to you featureclass&lt;/LI&gt;&lt;LI&gt;Ted showed that you can calculate the fields using Calculate Geometry (use X coordinate of Point for X and Y Coordinate of Point for Y)&lt;/LI&gt;&lt;LI&gt;Joshua offered a method to use a python syntax to fill the fields using the field calculator (!shape.firstPoint.X! for X and !shape.firstPoint.Y! for the Y field).&lt;/LI&gt;&lt;LI&gt;My suggestion has the ability to loop through all the featureclasses in a workspace and add the fields to each of them&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to decide which method suits your specific needs best.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jan 2015 03:04:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/adding-xy-fields-to-an-attribute-table/m-p/114705#M6534</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-17T03:04:27Z</dc:date>
    </item>
  </channel>
</rss>

