Suppress the Save dialog when DrawingDocument.Save

Suppress the Save dialog when DrawingDocument.Save

mowag
Enthusiast Enthusiast
422 Views
2 Replies
Message 1 of 3

Suppress the Save dialog when DrawingDocument.Save

mowag
Enthusiast
Enthusiast

 

I want to suppress this Save popup.

SavePopup.png

 

I've written a C# WPF app (.NET6.0).

I've tried this way, but the Event never fires ! 

And yes, the "Embed Interop Types" set to NO  on the Autodesk.Inventor.Interop reference.

 

_inventordataService.invApp.ApplicationEvents.OnSaveDocument += AppEvents_OnSaveDocument;
private void AppEvents_OnSaveDocument(_Document DocumentObject, EventTimingEnum BeforeOrAfter, NameValueMap Context, out HandlingCodeEnum HandlingCode)
 {
   HandlingCode = Inventor.HandlingCodeEnum.kEventHandled;
 }

 

 

Events.png

 

Kind Regards

Johan

0 Likes
Accepted solutions (2)
423 Views
2 Replies
Replies (2)
Message 2 of 3

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

Does this happen when user clicks save button, when closing unsaved document or when your program save? When your program saves, try using the Save2 method and set the SaveDependents option to true/false.

I'm not familiar with syntax creating event handler in C#, so I can't help this point. But only set HandlingCode will probably cause inconsistent data.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 3

mowag
Enthusiast
Enthusiast
Accepted solution

Hi, R.Krieg

 

Yep, that did the trick; Thanks for the help !

 

Save2.png

 

Kind Regards

Johan

0 Likes