|
在用.net的com技术对编程时,窗体无法与AUTOCAD交互操作.
代码如下:
(显示窗体)
Dim fm As New Form1
Application.ShowModalDialog(Application.MainWindow, fm) 或 fm.ShowDialog()
(窗体上的按钮代码)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Hide()
Dim ss As AcadSelectionSet
On Error Resume Next
Me.acadapp.ActiveDocument.SelectionSets.Item("*FQJY*").Delete()
ss = Me.acadapp.ActiveDocument.SelectionSets.Add("*FQJY*")
ss.Select(AcSelect.acSelectionSetWindow)
Me.Show()
End Sub
在点击Button1按钮后窗体隐藏,命令行也有提示要我选取对象,可autocad界面仍是灰色,无法进行选取操作.
是不是还有些工作要作?请大侠们指教,谢谢! |
|