Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

Suppress the Save dialog when DrawingDocument.Save

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mowag
258 Views, 2 Replies

Suppress the Save dialog when DrawingDocument.Save

 

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

2 REPLIES 2
Message 2 of 3
Ralf_Krieg
in reply to: mowag

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 GmbH
www.rkw-solutions.com
Message 3 of 3
mowag
in reply to: Ralf_Krieg

Hi, R.Krieg

 

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

 

Save2.png

 

Kind Regards

Johan

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

Post to forums  

Autodesk Design & Make Report