'========================= 'polygon_Get_X_Center.cal 'Author: Ianko Tchoukanski 'http://www.ian-ko.com '========================= On Error Resume Next Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pGeometry As IGeometry Dim pArea As IArea Dim pCenter As IPoint Dim dXCenter As Double Dim bSrefFromMap As Boolean '======================= 'Adjust the parameter below 'True ==> the coordinates will be calculated in the projection of the Map 'False ==> the coordinates will be calculated in the projection of the data bSrefFromMap = True '======================= If (Not IsNull([Shape])) Then Set pGeometry = [Shape] If (Not pGeometry.IsEmpty) Then If (bSrefFromMap) Then Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap pGeometry.Project pMap.SpatialReference End If Set pArea = pGeometry Set pCenter = pArea.Centroid dXCenter = pCenter.X End If End If __esri_field_calculator_splitter__ dXCenter