<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Access Vault's Generate File Number Event in custom C# Inventor addin in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/access-vault-s-generate-file-number-event-in-custom-c-inventor/m-p/13147616#M173904</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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 &lt;FONT color="#FF0000"&gt;HarnessPartNumber_AssemblyPartNumber.iam&lt;/FONT&gt;, where the &lt;FONT color="#FF0000"&gt;AssemblyPartNumber&lt;/FONT&gt; is the filename for the assembly the harness exists inside.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I can access the Cable and Harness button events through &lt;FONT color="#FF0000"&gt;UserInputEvents.OnActivateCommand&lt;/FONT&gt; and &lt;FONT color="#FF0000"&gt;UserInputEvents.OnTerminateCommand&lt;/FONT&gt;. When the user is &lt;STRONG&gt;not connected&lt;/STRONG&gt; to Vault, I use the &lt;FONT color="#FF0000"&gt;FileUIEvents.OnPopulateFileMetadata&lt;/FONT&gt; event to change the &lt;FONT color="#FF0000"&gt;FileMetadata&lt;/FONT&gt; object's file name to our required naming convention. This works as expected.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, when the user &lt;STRONG&gt;is connected&lt;/STRONG&gt; 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., &lt;FONT color="#FF0000"&gt;newPartNumber.iam&lt;/FONT&gt;), but the &lt;FONT color="#FF0000"&gt;OnPopulateFileMetadata&lt;/FONT&gt; 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.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My question is:&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;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?&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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 Vau&lt;STRONG&gt;lt.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any guidance or suggestions would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dfreemanPX2KX_0-1731483643497.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1433228i30E7FA04B2D7CD79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dfreemanPX2KX_0-1731483643497.png" alt="dfreemanPX2KX_0-1731483643497.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2024 08:56:31 GMT</pubDate>
    <dc:creator>dfreemanPX2KX</dc:creator>
    <dc:date>2024-11-13T08:56:31Z</dc:date>
    <item>
      <title>Access Vault's Generate File Number Event in custom C# Inventor addin</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/access-vault-s-generate-file-number-event-in-custom-c-inventor/m-p/13147616#M173904</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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 &lt;FONT color="#FF0000"&gt;HarnessPartNumber_AssemblyPartNumber.iam&lt;/FONT&gt;, where the &lt;FONT color="#FF0000"&gt;AssemblyPartNumber&lt;/FONT&gt; is the filename for the assembly the harness exists inside.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I can access the Cable and Harness button events through &lt;FONT color="#FF0000"&gt;UserInputEvents.OnActivateCommand&lt;/FONT&gt; and &lt;FONT color="#FF0000"&gt;UserInputEvents.OnTerminateCommand&lt;/FONT&gt;. When the user is &lt;STRONG&gt;not connected&lt;/STRONG&gt; to Vault, I use the &lt;FONT color="#FF0000"&gt;FileUIEvents.OnPopulateFileMetadata&lt;/FONT&gt; event to change the &lt;FONT color="#FF0000"&gt;FileMetadata&lt;/FONT&gt; object's file name to our required naming convention. This works as expected.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, when the user &lt;STRONG&gt;is connected&lt;/STRONG&gt; 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., &lt;FONT color="#FF0000"&gt;newPartNumber.iam&lt;/FONT&gt;), but the &lt;FONT color="#FF0000"&gt;OnPopulateFileMetadata&lt;/FONT&gt; 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.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My question is:&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;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?&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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 Vau&lt;STRONG&gt;lt.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any guidance or suggestions would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dfreemanPX2KX_0-1731483643497.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1433228i30E7FA04B2D7CD79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dfreemanPX2KX_0-1731483643497.png" alt="dfreemanPX2KX_0-1731483643497.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 08:56:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/access-vault-s-generate-file-number-event-in-custom-c-inventor/m-p/13147616#M173904</guid>
      <dc:creator>dfreemanPX2KX</dc:creator>
      <dc:date>2024-11-13T08:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Access Vault's Generate File Number Event in custom C# Inventor addin</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/access-vault-s-generate-file-number-event-in-custom-c-inventor/m-p/13266003#M175677</link>
      <description>&lt;P&gt;You'll need to use the Vault API, you can use the Vault connection from inside of Inventor.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using VB = Connectivity.Application.VaultBase;
...
public static Vlt.Currency.Connections.Connection GetInventorVaultConnection(Inventor.Application InvApp)
{
    Vlt.Currency.Connections.Connection connection = VB.ConnectionManager.Instance.Connection;

    if (connection is null ||!connection.IsConnected)
    {
        InvApp.CommandManager.ControlDefinitions["LoginCmdIntName"].Execute2(true);
        //InvApp.UserInterfaceManager.Ribbons["Assembly"].RibbonTabs["id_TabVault"].RibbonPanels["id_PanelZ_VaultAccess"].CommandControls["LoginCmdIntName"].ControlDefinition.Execute2(true);
        connection = VB.ConnectionManager.Instance.Connection;
    }
    return connection; 
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can use the&amp;nbsp;GenerateFileNumber() method in the DocumentService class to generate your numbers.&lt;BR /&gt;&lt;BR /&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2025 22:21:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/access-vault-s-generate-file-number-event-in-custom-c-inventor/m-p/13266003#M175677</guid>
      <dc:creator>mfoster9TD82</dc:creator>
      <dc:date>2025-01-16T22:21:57Z</dc:date>
    </item>
  </channel>
</rss>

