Open Addin-Form when "New File" is created

Open Addin-Form when "New File" is created

paul_hippe
Participant Participant
345 Views
3 Replies
Message 1 of 4

Open Addin-Form when "New File" is created

paul_hippe
Participant
Participant

Hi,

I just started using Visual Studio to create my own Inventor Addin in VB.Net.
I already created a Form that is opened when I press a button in a custom ribbon/tab.

 

Is it possible to open that form when I want to create a new file?
So when press I "New file" and have selected a template, the Form pops up.


Kind regards,
Paul

0 Likes
Accepted solutions (1)
346 Views
3 Replies
Replies (3)
Message 2 of 4

Michael.Navara
Advisor
Advisor
Accepted solution

This is possible. You need to hook to the appropriate event such as ApplicationEvents.OnNewDocument.

For the testing which event is the best for you, you can use EventWatcher app from Inventor SDK.

Message 3 of 4

WCrihfield
Mentor
Mentor

Hi @paul_hippe.  That sounds like you would want to use the following Inventor API Event:

FileUIEvents.OnFileNewDialog 

It says that you can override it to show your own dialog if you want, but it does not seem to offer any 'context' at this point in time.

There is also the FileUIEvents.OnFileNew Event, but this it does not sound like the proper one for your situation.

 

Edit:  On second thought, it does not have the EventTimingEnum, so you could not react during the 'kAfter' timing of that event, so the 'OnNewDocument' event, which does offer 'timing' and 'kBefore' reaction, does sound like it might be more appropriate.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4

paul_hippe
Participant
Participant

@Michael.Navara @WCrihfield 
Thanks for your tips. I got it working.
The ApplicationEvents.OnNewDocument. was the one I was looking for.
The EventWatcher from the SDK was super helpful.

Thanks You


Kind regards,
Paul

0 Likes