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

Check if form is open

GeorgK
Advisor

Check if form is open

GeorgK
Advisor
Advisor

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

0 Likes
Reply
Accepted solutions (1)
796 Views
3 Replies
Replies (3)

GeorgK
Advisor
Advisor
Accepted solution
I got it running.
Thanks
0 Likes

Anonymous
Not applicable

Hi,

 

i need exactly what you described.

But i can't find the "openForms"-Method in the "Inventor.Application"-class.

In the third row you wrote "m_inventorApplication.OpenForms"

and in the row before you wrote "m_inventorApplication.ActiveDocumentType".

So i'm assuming "M_inventorApplication" is an instance of the "Inventor.application"-Class.

 

I know the "OpenForms"-Method from "System.Windows.Forms", but how could

you implement this in your Inventor-class?

 

i need exactly such a function.

could you please post the correct code with all i need to know which and how much

forms are actually opened in Inventor?

 

thanks!

 

 

0 Likes

Peterjan.Schakel
Explorer
Explorer

Hey Xi8000

 

i know it's a long time ago but did you manage to figure it out.

i know its realy frustrating when people say they have a problem and afterwards reply that they fixed it but don;t tell you how....