Calculate the field attribute table ARCGIS Magical

[Switch] 
In ARCGIS property sheet, generally will not contain solid geometry information, it can be calculated taking VBA. Here are a few simple code (Reprinted from brainstorming College) Features: 1 Tell a friend will not use AO 2 can be saved as a file for the next CAL convenience to use 1 Open the property sheet, select the field of computing, the right Values point selection the Calculate;
2 . select "yes", enter the Calculator Field,; 2 Advance option selected; 3 in Pre- input VBA code Logic VBA Script Code edit box; 4 below edit box assignment part. . 1 - point coordinate X- the VBA part: Dim pGeo of As IGeometry the Set pGeo = [the Shape] Dim pPoint of As the IPoint the Set pPoint = pGeo assignment part: pPoint.X 2 - coordinates the Y the VBA part: ibid assignment part: pPoint.Y The intrinsic value of the coordinate value file storage, and whether to use the On the Fly coordinate-independent representation. Returns the current display coordinate values with reference 8, . 9 . 3 - polygonal perimeter VBA Part: Dim pGeo of As IGeometry the Set pGeo = [the Shape] Dim pPolygon of As the IPolygon the Set pPolygon = pGeo assignment section: pPolygon.Length . 4 - polygon area VBA portion : Dim pGeo of As IGeometry the Set pGeo = [the Shape] Dim pPolygon of As the IPolygon the Set pPolygon = pGeo Dim Parea of As IArea the Set Parea = pPolygon assignment section: pArea.Area . 5 - polygon focus X- the VBA part: PGeo of As IGeometry Dim PGeo SET Dim pCurve of As IPolycurve = [the Shape] Dim pPolygon of As the IPolygon SET pPolygon = pGeo Dim Parea of As IArea SET Parea = pPolygon Dim pPoint of As the IPoint SET pPoint = pArea.Centroid assignment section: pPoint.X . 6 - polygon focus the Y the VBA part: ibid assignment part : pPoint.Y . 7 - the Polyline length VBA part: Dim pGeo of As IGeometry the Set pGeo = [the Shape] Dim pPolyline of As IPolyline the Set pPolyline = pGeo the Set pCurve = pPolyline assignment part: pCurve.Length . 8 - point representing the coordinates X- the VBA part: Dim pDoc of As IMxDocument the Set pDoc = the ThisDocument Dim pSpRef of As ISpatialReference the Set pSpRef = pDoc.FocusMap.SpatialReference Dim pClone of As iClone the Set pClone = [the Shape] Dim pGeo of As IGeometry the Set pGeo = pClone.Clone Dim pPoint AS the IPoint the Set pPoint = pGeo pGeo.Project pSpRef assignment part: pPoint.X . 9 - a point representing the coordinates of the Y the VBA part: ibid assignment part: pPoint.Y

 

Guess you like

Origin www.cnblogs.com/jordonin/p/12028282.html