Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
GeorgK
794 Views, 3 Replies

Check if form is open

Hello together,

 

I have an add-in with a form.

 

How could I check if the form is open or not? This does not work:

 

 'Ensure active document is a Drawing
If m_inventorApplication.ActiveDocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
	For Each form In m_inventorApplication.OpenForms
		If (form.name = "Form_To_Check") Then
			'form is loaded so can do work 
			'if you need to check whether it is actually visible
			If form.Visible Then
				'do work when visible
			End If
		Else
			Dim MyLocalForm As New Form_To_Check
			MyLocalForm.Show(New WindowWrapper(m_inventorApplication.MainFrameHWND)) 
		End If
	Next
End If

 

Thanks for your help

 

Georg