HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - HK2 (...
VBA Script
2. 1 | P a g e
VBA Script for point, line, and polygon
The different VBA scripts for point, line, and polygon for the Arc GIS 9.3 are
given as follows:
1. Polygons
The scripts for the calculation of the Area of a polygon are stated below:
Dim dblArea as double
Dim pArea as IArea
Set pArea = [shape]
dblArea = pArea.area
Under field of AREA type, dblArea. And click OK.
dim dbarea as double
dim pArea as Iarea
set pArea = pArea.area
Under the field of AREA type, dbArea. And click OK.
3. 2 | P a g e
Where,
Area = by above mentioned 1st
field calculator script
Area_1 = by Calculate Geometry
Area_field = = by above mentioned 2nd
field calculator script
RESULT: Performed!
2. Lines
The script for the length calculation of a line is as follows:
Dim dblLength as double
Dim pCurve as ICurve
Set pCurve = [shape]
dblLength = pCurve.Length
Under the field of Length type, dblLength. And click OK.
Where,
Length = by above mentioned 1st
field calculator script
Length_1 = by Calculate Geometry
4. 3 | P a g e
RESULT: Performed!
3. Points
To calculate the X and Y coordinates of a point, the following syntax is used:
X-coordinate of a point:
Dim dblX As Double
Dim pPoint As IPoint
Set pPoint = [Shape]
dblX = pPoint.X
Under the field of X type, dblX. And click OK.
Y-coordinate of a point:
Dim dblY As Double
Dim pPoint As IPoint
Set pPoint = [Shape]
dblY = pPoint.Y
Under the field of Y type, dblY. And click OK.
5. 4 | P a g e
Where,
X,Y = by above mentioned 1st
field calculator script
X_1, Y_1 = by Calculate Geometry
RESULT: Performed!