Message 1 of 3
Inventor FileUIEvent.OnFileSaveAsDialog overwrite default dialog not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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;
}
}