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: 

Inventor 2022 OnFileSaveAsDialog Event

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
julian_sol
980 Views, 11 Replies

Inventor 2022 OnFileSaveAsDialog Event

Hi,

 

Since I've updated to Inventor 2022 (and it's API) my OnFileSaveAsDialog Event does not trigger anymore on saving a new file. Instead I get this new save dialog:

 

SaveScreen.png

Did the OnFileSaveAsDialog event change? How can I capture this command in the new version?

Labels (2)
11 REPLIES 11
Message 2 of 12
Ralf_Krieg
in reply to: julian_sol

Hello

 

Afaik there's no change on this event.

How did you catch this event? VBA, iLogic, VB.Net Addin?

The Dialog looks like Vault? Have you used it also before 2022?


R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com
Message 3 of 12
julian_sol
in reply to: Ralf_Krieg

Thanks for your response. It is indeed the Vault Plugin that is causing this dialog to pop up.

I'm catching the event in a C# .NET plugin as below:

        private Inventor.Application InventorApplication { get; set; }
        private FileUIEvents FileUiEvents { get; set; }

        public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime)
        {
            // Initialize AddIn members.
            InventorApplication = addInSiteObject.Application;

            FileUiEvents = InventorApplication.FileUIEvents;
            FileUiEvents.OnFileSaveAsDialog += FileUiEventsOnOnFileSaveAsDialog;
        }


        private void FileUiEventsOnOnFileSaveAsDialog(ref string[] filetypes, bool savecopyas, int parenthwnd, out string filename, NameValueMap context, out HandlingCodeEnum handlingcode)
        {
           // NORMALLY I WOULD OPEN A CUSTOM WINDOW HERE
            throw new NotImplementedException();
        }

If I logout of Vault, the code works and the event is triggered. If I'm logged in I get the Vault dialog.

Would you know how to turn this off or skip this? Thanks!

Message 4 of 12
Ralf_Krieg
in reply to: julian_sol

Hello

 

Afaik, if two or more Addins listen to the same event, there's no possibility to define the order the Addins code run. I'm not familar with Vault. The Basic client offers no API. If it's a higher version, maybe one of the following ideas can help:

- Check if it's possible to configure Vault plugin to not listen on this event.

- Check if there's an event in Vault API open the dialog (CreateNewFileDialog) and create a handler to suppress the Vault dialog and display your own.

 

 


R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com
Message 5 of 12

Vault API does not support that kind of events!

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 6 of 12
julian_sol
in reply to: julian_sol

I found what was causing the unwanted dialog to show up. It's the extra Vault Datastandard Addin. It uses the same save command ID and this apparently overwrites the standard Inventor save method. 

Message 7 of 12
Ralf_Krieg
in reply to: julian_sol

Hello

 

Maybe an interesting article

https://knowledge.autodesk.com/support/vault-products/learn-explore/caas/CloudHelp/cloudhelp/2020/EN...


R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com
Message 8 of 12
julian_sol
in reply to: Ralf_Krieg

Thank you, that's definitely useful. I don't think we'll need the Datastandard Addin at all, but it's good to know something exists to bypass this!

Message 9 of 12
wood.isbell
in reply to: julian_sol

This conversation seemed relevant to an issue I am having, but I am not running the Data Standard add-in and my handler is not being called with or without being logged into Vault. I am using the same handling method, and it worked in 2020, but not in 2022.

 

Separately, I confirmed that it is not another add-in by disabling everything outside of my add-in; no dice.

Message 10 of 12
wood.isbell
in reply to: julian_sol

Forget that. I forgot to set the new DLL as Embed Interop Types = False.

Message 11 of 12
boris.anicic
in reply to: wood.isbell

Thanks man, you saved me.

Message 12 of 12
amriSWAA3
in reply to: wood.isbell

This fixed my issue. Thanks @wood.isbell 

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

Post to forums  

Autodesk Design & Make Report