Access Vault's Generate File Number Event in custom C# Inventor addin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm developing an add-in for Autodesk Inventor 2023 to assist with automation tasks in my workplace, and we're using Vault Professional 2023 for file management.
As part of this process, I'm attempting to change the default placeholder filename that appears when selecting the "Insert Cable and Harness" button (Insert New Harness command) in an assembly's Environment tab (or when running this command through API calls). The goal is to enforce our company's naming convention automatically, so users don't have to manually change the name every time. Specifically, our harness files should be named in a format similar to HarnessPartNumber_AssemblyPartNumber.iam, where the AssemblyPartNumber is the filename for the assembly the harness exists inside.
I can access the Cable and Harness button events through UserInputEvents.OnActivateCommand and UserInputEvents.OnTerminateCommand. When the user is not connected to Vault, I use the FileUIEvents.OnPopulateFileMetadata event to change the FileMetadata object's file name to our required naming convention. This works as expected.
However, when the user is connected to Vault and needs to create a new part number for the harness, they use the Vault add-in's "Generate File Number" dialog box. The auto-generated part number is then used as the default filename in the create harness dialog box (e.g., newPartNumber.iam), but the OnPopulateFileMetadata event does not fire in this case. This means I cannot modify the default file name to include the new part number and match our naming convention.
My question is:
Is there a way to access the Vault add-in's "Generate File Number" dialog event or obtain the generated part number before the create harness dialog appears, so I can modify the default placeholder name accordingly?
I've considered integrating with the Vault API but haven't found a method to intercept the generated part number or an event that I can subscribe to for this purpose. I'm also open to alternative solutions that would allow me to enforce our naming convention during harness creation when connected to Vault.
Any guidance or suggestions would be greatly appreciated.
Thank you!