AnsweredAssumed Answered

Programmatically using Field Calculator to update XY co-ordinates with ArcGIS 10

Question asked by natsykes on Apr 27, 2012
Latest reply on Apr 12, 2014 by rfairhur24
My company is going through the process of upgrading our software to ArcGIS 10.0 from 9.3.1, half the machines are now at 10.0 and half are still on 9.3.1.  I'm in the process of upgrading all our VBA code to VB.NET and add-ins.

My current problem is with calling the Field Calculator programmatically.  With 9.3.1 I was able to use ArcObjects in the pre-expression to define a shape and extract the X or Y co-ordinates.  I know that with 10.0 the VBA has been retired and I now have the choice of VB Script or Python.  If I have the attribute table open and directly use the Field Calculator, the Python line !shape.extent.XMax! does exactly what I want.

Is there any way I can get this to work in the VB.NET code that I am using with the add-in.  I can call the calculator but I think I've seen that it's a known bug that you can't define what parser will be used in the calculator, thus defaulting to VB Script (which I don't think will extract/identify the X/Y co-ordinate - but correct me if I'm wrong).

Any help with this would be greatly appreciated.

Outcomes