在Scene或Globe中绘制橡皮条线的工具,其中wsUtilityBaseTool是我自己封装的基类,
大家只需要把它替换成AE的BaseTool,把其中相应的代码放在相应的函数中,然后再进行一些简单的修改就好了
附上VB.Net源码
Imports ESRI.ArcGIS.Analyst3D
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.Controls
Imports ESRI.ArcGIS.Display
Imports ESRI.ArcGIS.Geometry
Imports ESRI.ArcGIS.GlobeCore
Imports ESRI.ArcGIS.SystemUI
Public Class wsSceneDrawLine
Inherits wsUtilityBaseTool
Private Declare Function Polygon Lib "gdi32" (ByVal hDC As Integer, ByVal lpPoint As Integer, ByVal nCount As Integer) As Integer
Private Declare Function SetCapture Lib "USER32" (ByVal hWnd As Integer) As Integer
Private Declare Function GetCapture Lib "USER32" () As Integer
Private Declare Function ReleaseCapture Lib "USER32" () As Integer
Private Declare Function GetCursorPos Lib "USER32" (ByVal lpPoint As PointAPI) As Integer
Private Declare Function SetCursor Lib "USER32" (ByVal hCursor As Integer) As Integer
Private Declare Function GetClientRect Lib "USER32" (ByVal hWnd As Integer, ByVal lpRect As rect) As Integer
Private Declare Function GetWindowRect Lib "USER32" (ByVal hWnd As Integer, ByVal lpRect As rect) As Integer
Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Integer, ByVal nWidth As Integer, ByVal crColor As Integer) As Integer
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Integer) As Integer
Private Declare Function GetROP2 Lib "gdi32" (ByVal hDC As Integer) As Integer
Private Declare Function SetROP2 Lib "gdi32" (ByVal hDC As Integer, ByVal nDrawMode As Integer) As Integer
Private Declare Function Rectangle Lib "gdi32" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Integer, ByVal hObject As Integer) As Integer
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Integer) As Integer
Private Declare Function Polyline Lib "gdi32" (ByVal hDC As Integer, ByVal lpPoint() As PointAPI, ByVal nCount As Integer) As Integer
Private Declare Function CreatePolygonRgn Lib "gdi32" (ByVal lpPoint As Integer, ByVal nCount As Integer, ByVal nPolyFillMode As Integer) As Integer
Private Structure rect
Dim Left As Integer
Dim Top As Integer
Dim Right As Integer
Dim Bottom As Integer
End Structure
Private Structure PointAPI
Dim x As Integer
Dim y As Integer
End Structure