Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime
Public Class Class1
<CommandMethod("MouseGetID")> _
Public Sub MouseGetID()
'获取编辑器
Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
'获取点的监视事件
AddHandler Ed.PointMonitor, AddressOf ed_PointMonitor
End Sub
Sub ed_PointMonitor(ByVal sender As Object, ByVal e As PointMonitorEventArgs)
'拾取当前实体对象提交
Dim Fsp As FullSubentityPath() = e.Context.GetPickedEntities
If Fsp.Length > 0 Then
e.AppendToolTipText("")
' 显示实体ID
e.AppendToolTipText(Fsp(0).GetObjectIds(0).ToString)
End If
End Sub
End Class
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime
Public Class Class1
<CommandMethod("MouseGetID")> _
Public Sub MouseGetID()
'获取编辑器
Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
'获取点的监视事件
AddHandler Ed.PointMonitor, AddressOf ed_PointMonitor
End Sub
Sub ed_PointMonitor(ByVal sender As Object, ByVal e As PointMonitorEventArgs)
'拾取当前实体对象提交
Dim Fsp As FullSubentityPath() = e.Context.GetPickedEntities
If Fsp.Length > 0 Then
e.AppendToolTipText("")
' 显示实体ID
e.AppendToolTipText(Fsp(0).GetObjectIds(0).ToString)
End If
End Sub
End Class
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |