Public Class ArxApi
_
Public Shared Function acedCoordFromPixelToWorld(ByVal viewportNumber As Integer, ByVal pixel As System.Drawing.Point, ByRef point As Point3d) As Boolean
'''
'''
End Function
'''
_
Public Shared Function acedCoordFromWorldToPixel(ByVal viewportNumber As Integer, ByVal worldPt As Point3d, ByRef pixel As System.Drawing.Point) As Boolean
'''
'''
End Function
'''
End Class
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.EditorInput
Public Class Class1
Private MousePoint As Point3d = New Point3d(0, 0, 0) '保存当前鼠标位置
_
Public Sub test()
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
AddHandler ed.PointFilter, AddressOf GetMousePoint
Dim pro As PromptPointOptions = New PromptPointOptions("按左键退出...")
ed.GetPoint(pro)
RemoveHandler ed.PointFilter, AddressOf GetMousePoint
End Sub
''动态获取鼠标位置
Private Sub GetMousePoint(ByVal sender As Object, ByVal e As PointFilterEventArgs)
MousePoint = e.Context.ComputedPoint
Dim m_ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
m_ed.WriteMessage("当前鼠标位置: " + vbLf + "X=" + MousePoint.X.ToString + vbLf + "Y=" + MousePoint.X.ToString + vbLf + "Z=" + MousePoint.Z.ToString + vbLf)
End Sub
End Class