我有一个代码可以创建一个选择窗口。
我需要编辑代码,以便用户可以选择屏幕上的窗口点,而不是硬编码的点
有什么想法吗?
-
- Public Class Class1
- <CommandMethod("selectwindowa")> _
- Public Sub selectwindowa()
- Dim mydwg As Document = DocumentManager.MdiActiveDocument
- Dim myeditor As Editor = DocumentManager.MdiActiveDocument.Editor
- Dim mypsr As PromptSelectionResult = mydwg.Editor.SelectWindow( _
- New Point3d(-2, -2, 0), New Point3d(2, 2, 0))
- If mypsr.Status = PromptStatus.OK Then
- Using myTrans As Transaction = mydwg.TransactionManager.StartTransaction
- For Each myObjectID As ObjectId In mypsr.Value.GetObjectIds
- Dim myEnt As Entity = myObjectID.GetObject(OpenMode.ForRead)
- MsgBox(myEnt.Layer & vbTab & myEnt.GeometricExtents.ToString)
- Next
- End Using
- End If
|