[GIS] How to convert existing fields to lat and long using the Calculate Field tool

arcgis-9.3arcobjects

I am trying to convert my X and Y fields from feet to lat and long. I can easily do this in Calculate Geometry from the attribute table, but I'm needing to use this in a model and Calculate Geometry is not available as a tool. I'm using the Calculate Field tool and trying to find a script that converts this to lat and long. I've tried the following script using the advanced code for VBA with no luck:

Dim dblX As Double
Dim pPoint As IPoint
Set pPoint = [Shape]
dblX = pPoint.X

dblX

I'd like to avoid having to create a totally new shapefile or feature class. I just want to change the existing fields in this existing feature class.

Thanks!!

Best Answer

Here are some Calculate Field examples. If you scroll down about 3/4 of the way you'll see some examples for Geometry Unit conversion.

For scripting, you might consider adding fields as opposed to editing existing ones.

Related Question