AutoCAD鼠标经过处的坐标



Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Public Class Class1
    <CommandMethod("test")> Public Sub test()
        Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        AddHandler Ed.PointMonitor, New PointMonitorEventHandler(AddressOf Getpoint)
    End Sub
    Public Sub Getpoint(ByVal sender As Object, ByVal e As PointMonitorEventArgs)
        Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        Ed.WriteMessage(vbNewLine & e.Context.RawPoint.X)
        'RemoveHandler Ed.PointMonitor, AddressOf Getpoint
    End Sub
End Class



Win10不支持您的AutoCAD版本



欢迎关注微信公众账号ByCAD