Ahhh.. The dreaded modal form questions persist....
I need to have a form displayed that does not allow the user to interact with AutoCAD while it is visible. But, when they click a button to select objects, a point or whatever, the form will disappear, roll up, whatever, allow the user to perform the action, then reappear. I seen other questions like this and the responses on how to handle it but I think .NET is different.
Example:
Public Class Commands
<CommandMethod("MyCommand")> _
Public Sub MyCommand ()
Try
Dim Fp As New Form
Fp.ShowDialog()
'if I hide the form at anytime while it is displayed
'like when the user clicks a button to select a point
'this next line is executed and an exception is thrown
'saying: AutoCAD main window is invisible
MessageBox.show("You picked point: " fp.InsertionPoint)
Catch ex As Exception
Throw ex
End Try
End Sub
Public Class FormIP
Public Insertionpoint As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pt As Double()
Me.Hide()
AcadTlc.ActiveDrawing.Utility.GetPoint(pt, "Select a point: ")
Insertionpoint = pt(0).ToString & ", " & pt(1).ToString
Me.Show()
End Sub
End Class
Any help would be greatly appreciated… Thanks in advance.