Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OnFileSaveAsDialog event problem

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
636 Views, 2 Replies

OnFileSaveAsDialog event problem

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...

 

2 REPLIES 2
Message 2 of 3
bretrick30
in reply to: Anonymous

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

Message 3 of 3
Anonymous
in reply to: bretrick30

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report