Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

OnFileSaveAsDialog event problem

Anonymous

OnFileSaveAsDialog event problem

Anonymous
Not applicable

Hello.

I have got some unusual issue while trying to catch OnFileSaveAsDialog event in Inventor 2019.

My simple program should just show its own message box before FileSaveAsDialog.

 public class StandardAddInServer : Inventor.ApplicationAddInServer {
        private Inventor.Application m_inventorApplication;
public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime) { m_inventorApplication = addInSiteObject.Application; (breakpoint) m_inventorApplication.FileUIEvents.OnFileSaveAsDialog += FileUIEvents_OnFileSaveAsDialog; } private void FileUIEvents_OnFileSaveAsDialog(ref string[] FileTypes, bool SaveCopyAs, int ParentHWND, out string FileName, NameValueMap Context, out HandlingCodeEnum HandlingCode) { FileName = ""; HandlingCode = HandlingCodeEnum.kEventNotHandled; MessageBox.Show("Hello World!"); }
... }

While debugging, my message box is shown only if I set breakpoint (see code above). The same code does not work without setting breakpoint.

PlugIn Loading.pngIn release mode, my plugin works only if it had been loaded manually, but not automatically.

 

P.S. This post didn`t help me: https://forums.autodesk.com/t5/inventor-customization/onfilesaveasdialog-event-won-t-fire/m-p/371748...

 

Reply
Accepted solutions (1)
628 Views
2 Replies
Replies (2)

bretrick30
Advocate
Advocate
Accepted solution

Hello,

 

I know your post is a few months old, maybe you have figured out your issue by now, but in your .addin file, do you have LoadOnStartUp set to 1 as shown below?

 

 

Capture.PNG

Anonymous
Not applicable

Hello
Thanks for your feedback.

OnStartUp setting in my .addin file was set the same as on your picture.

But the problem has really been solved by updating main class GUID attribute.

0 Likes