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

Inventor FileUIEvent.OnFileSaveAsDialog overwrite default dialog not working

Hello,

I am trying to overwrite the default save dialog and replace it with my own. I have already done this in previous versions of Inventor and it worked without any problems.
But now, in version 2025, I have no success.

The event is registered in the Activate function of my plugin and does not throw an error. However, when I then save and my own dialog should appear, only the standard Inventor dialog appears.

Can anyone recognize an error or has a similar problem?

 

Here is my short code:

 

 public void Activate ( Inventor.ApplicationAddInSite addInSiteObject, bool firstTime )
 {
     // This method is called by Inventor when it loads the addin.
     // The AddInSiteObject provides access to the Inventor Application object.
     // The FirstTime flag indicates if the addin is loaded for the first time.

     // Initialize AddIn members.
     m_inventorApplication = addInSiteObject.Application;          

     FileUIEvents fileUIEvents = m_inventorApplication.FileUIEvents;
     fileUIEvents.OnFileSaveAsDialog += FileUIEvents_OnFileSaveAsDialog;

     // TODO: Add ApplicationAddInServer.Activate implementation.
     // e.g. event initialization, command creation etc.
 }



 private void FileUIEvents_OnFileSaveAsDialog ( ref string[ ] FileTypes, bool SaveCopyAs, int ParentHWND, out string FileName, NameValueMap Context, out HandlingCodeEnum HandlingCode )
 {
     SaveDialog saveDialog = new SaveDialog( );

     bool result = ( bool ) saveDialog.ShowDialog( );

     if ( result )
     {
         HandlingCode = HandlingCodeEnum.kEventCanceled;
         FileName = null;
     }
     else
     {
         HandlingCode = HandlingCodeEnum.kEventCanceled;
         FileName = null;
     }

 }