完全通过field Calculate实现:
1.新建字段[coordinate] ,类型设置为text,长度默认50,右击该字段,选择field Calculate,点advanced,填入一下表达式:
' ----------------------------------------
' @ Tsonghua 090924
' ----------------------------------------
Dim Output As string
Dim pPoint As IPoint
Set pPoint = [Shape]
Output = pPoint.X & "," & pPoint.Y
复制代码
2.新建字段[Dup],类型设置为 long integer,右键选field Calculate,在advanced的表达式框中填入:
' ----------------------------------------
' @ Tsonghua 090924
' ----------------------------------------
Static d As Object
Static i As Long
Dim iDup As Integer
Dim sField
' ----------------------------------------
'这里填写需要检查的字段名
sField = [coordinate]
' ----------------------------------------
If (i = 0) Then
Set d = CreateObject("Scripting.Dictionary")
End If
If (d.Exists(CStr(sField))) Then
iDup = 1
Else
d.Add CStr(sField), 1
iDup = 0
End If
i = i + 1
复制代码
3.这样,只需要挑选出[Dup]字段值为1的删掉即可。