<?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 Vault connection using API not working outside Inventor Addin solution project in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12767015#M878</link>
    <description>&lt;P&gt;I'm working on an Inventor Addin, where I created a button for the users to acquire the latest Vault settings and files (style library, iLogic rules, templates etc.).&lt;/P&gt;&lt;P&gt;To do this, I'm using the Vault API, and I have a successful connection up and running&amp;nbsp;&lt;EM&gt;within&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the project file that defines the addin (essentially based on the Inventor Addin-template, provided by Autodesk). That project is the one called "InventorAddin" in my solution (see attached screendump).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have separated all functionality of the addin out into a different project (the WorkerModule), and I'm testing this functionality using the TesterModule, so I don't have to wait for Inventor to start up, every time I want to debug something new. Once it's working, I call it inside the InventorAddin project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the issue:&lt;/P&gt;&lt;P&gt;As mentioned, I have Vault API code up and running, successfully establishing a connection,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;directly&amp;nbsp;inside&amp;nbsp;&lt;/EM&gt;the InventorAddin project. However, if I move it to the WorkerModule (moving all necessary references and imports with it, of course), and calling the function from either the TesterModule or directly in the InventorAddin project, the connection is just not happening.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Why? What am I missing? I'm thinking I need to pass some reference object from the source to the function, but I'm out of ideas...&lt;/P&gt;&lt;P&gt;The code inside the WorkerModule is shown below. There are a few redundant imports, but I haven't digged into which, so just included all of them.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Imports System.Runtime.InteropServices
Imports System.Security.Cryptography
Imports System.Windows.Forms
Imports Inventor
Imports Microsoft.Win32

Imports System.Collections.Generic
Imports System.Linq
Imports System.Text

Imports Autodesk.Connectivity.Extensibility.Framework
Imports Autodesk.Connectivity.WebServices

Imports AWS = Autodesk.Connectivity.WebServices
Imports VDF = Autodesk.DataManagement.Client.Framework
Imports VB = Connectivity.Application.VaultBase
Imports Autodesk.DataManagement.Client.Framework.Vault.Currency

Public Class clsGet
    Public inv_app As Inventor.Application = Nothing
    Public Sub getFromVault()

        Dim connection As VDF.Vault.Currency.Connections.Connection
        connection = VB.ConnectionManager.Instance.Connection

        Dim settings As VDF.Vault.Settings.AcquireFilesSettings = New VDF.Vault.Settings.AcquireFilesSettings(connection)

        ' Start at the root Folder.
        Dim root As VDF.Vault.Currency.Entities.Folder = connection.FolderManager.RootFolder

        Dim folders As IEnumerable(Of VDF.Vault.Currency.Entities.Folder) = connection.FolderManager.GetChildFolders(root, True, False)
        If folders IsNot Nothing AndAlso folders.Any() Then
            For Each folder In folders

                If folder.FullName = "$/CAD/NTI iTools 2023.ERP" Or folder.FullName = "$/CAD/Inventor 2023.ERP/Templates" Or
                    folder.FullName.Contains("$/CAD/HM Tools") Or folder.FullName.Contains("$/CAD/NTI iLogic 2023.ERP") Then

                    Dim childFiles As Autodesk.Connectivity.WebServices.File() = connection.WebServiceManager.DocumentService.GetLatestFilesByFolderId(folder.Id, False)
                    If childFiles IsNot Nothing Then
                        For Each file As Autodesk.Connectivity.WebServices.File In childFiles
                            Dim FileItter = New VDF.Vault.Currency.Entities.FileIteration(connection, file)
                            settings.AddFileToAcquire(FileItter, VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Download)
                        Next
                    End If
                    connection.FileManager.AcquireFiles(settings)
                End If
                settings = New VDF.Vault.Settings.AcquireFilesSettings(connection)
            Next
        End If
    End Sub

End Class&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 11 May 2024 20:38:51 GMT</pubDate>
    <dc:creator>Anders_Olsen</dc:creator>
    <dc:date>2024-05-11T20:38:51Z</dc:date>
    <item>
      <title>Vault connection using API not working outside Inventor Addin solution project</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12767015#M878</link>
      <description>&lt;P&gt;I'm working on an Inventor Addin, where I created a button for the users to acquire the latest Vault settings and files (style library, iLogic rules, templates etc.).&lt;/P&gt;&lt;P&gt;To do this, I'm using the Vault API, and I have a successful connection up and running&amp;nbsp;&lt;EM&gt;within&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the project file that defines the addin (essentially based on the Inventor Addin-template, provided by Autodesk). That project is the one called "InventorAddin" in my solution (see attached screendump).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have separated all functionality of the addin out into a different project (the WorkerModule), and I'm testing this functionality using the TesterModule, so I don't have to wait for Inventor to start up, every time I want to debug something new. Once it's working, I call it inside the InventorAddin project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the issue:&lt;/P&gt;&lt;P&gt;As mentioned, I have Vault API code up and running, successfully establishing a connection,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;directly&amp;nbsp;inside&amp;nbsp;&lt;/EM&gt;the InventorAddin project. However, if I move it to the WorkerModule (moving all necessary references and imports with it, of course), and calling the function from either the TesterModule or directly in the InventorAddin project, the connection is just not happening.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Why? What am I missing? I'm thinking I need to pass some reference object from the source to the function, but I'm out of ideas...&lt;/P&gt;&lt;P&gt;The code inside the WorkerModule is shown below. There are a few redundant imports, but I haven't digged into which, so just included all of them.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Imports System.Runtime.InteropServices
Imports System.Security.Cryptography
Imports System.Windows.Forms
Imports Inventor
Imports Microsoft.Win32

Imports System.Collections.Generic
Imports System.Linq
Imports System.Text

Imports Autodesk.Connectivity.Extensibility.Framework
Imports Autodesk.Connectivity.WebServices

Imports AWS = Autodesk.Connectivity.WebServices
Imports VDF = Autodesk.DataManagement.Client.Framework
Imports VB = Connectivity.Application.VaultBase
Imports Autodesk.DataManagement.Client.Framework.Vault.Currency

Public Class clsGet
    Public inv_app As Inventor.Application = Nothing
    Public Sub getFromVault()

        Dim connection As VDF.Vault.Currency.Connections.Connection
        connection = VB.ConnectionManager.Instance.Connection

        Dim settings As VDF.Vault.Settings.AcquireFilesSettings = New VDF.Vault.Settings.AcquireFilesSettings(connection)

        ' Start at the root Folder.
        Dim root As VDF.Vault.Currency.Entities.Folder = connection.FolderManager.RootFolder

        Dim folders As IEnumerable(Of VDF.Vault.Currency.Entities.Folder) = connection.FolderManager.GetChildFolders(root, True, False)
        If folders IsNot Nothing AndAlso folders.Any() Then
            For Each folder In folders

                If folder.FullName = "$/CAD/NTI iTools 2023.ERP" Or folder.FullName = "$/CAD/Inventor 2023.ERP/Templates" Or
                    folder.FullName.Contains("$/CAD/HM Tools") Or folder.FullName.Contains("$/CAD/NTI iLogic 2023.ERP") Then

                    Dim childFiles As Autodesk.Connectivity.WebServices.File() = connection.WebServiceManager.DocumentService.GetLatestFilesByFolderId(folder.Id, False)
                    If childFiles IsNot Nothing Then
                        For Each file As Autodesk.Connectivity.WebServices.File In childFiles
                            Dim FileItter = New VDF.Vault.Currency.Entities.FileIteration(connection, file)
                            settings.AddFileToAcquire(FileItter, VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Download)
                        Next
                    End If
                    connection.FileManager.AcquireFiles(settings)
                End If
                settings = New VDF.Vault.Settings.AcquireFilesSettings(connection)
            Next
        End If
    End Sub

End Class&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 11 May 2024 20:38:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12767015#M878</guid>
      <dc:creator>Anders_Olsen</dc:creator>
      <dc:date>2024-05-11T20:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Vault connection using API not working outside Inventor Addin solution project</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12782973#M879</link>
      <description>&lt;P&gt;Hi Anders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't have Inventor running, you don't have access to Connectivity.Application.VaultBase, so you won't be able to get the Connection object from VB.ConnectionManager.Instance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You 'll need to implement login functionality in your TesterModule, and pass the Connection object from that into your worker module&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It might mean that you have to separate out the code that gets the Connection object into it's own module, but that shouldn't prove too difficult&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 May 2024 06:19:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12782973#M879</guid>
      <dc:creator>Nick_Hall</dc:creator>
      <dc:date>2024-05-19T06:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Vault connection using API not working outside Inventor Addin solution project</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12783303#M880</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7162092"&gt;@Nick_Hall&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you! I just managed to get it working by establishing only the connection within the source code for the addin - where Inventor takes care of loggin into the Vault - and passing it to the working module, which takes care of the rest.&lt;/P&gt;&lt;P&gt;To make any unknown future adjustments though, I would need to run Inventor each time I need to debug, so it would be prefereable to have the TesterModule be able to handle the login by itself, using the API, as you mention.&lt;/P&gt;&lt;P&gt;I quickly tried searching for how to log in with the api, without luck. A deep dive would probably help, but your help might be a bit faster - can you show me how? &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Anders&lt;/P&gt;</description>
      <pubDate>Sun, 19 May 2024 13:19:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12783303#M880</guid>
      <dc:creator>Anders_Olsen</dc:creator>
      <dc:date>2024-05-19T13:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Vault connection using API not working outside Inventor Addin solution project</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12783678#M881</link>
      <description>&lt;P&gt;Hi Anders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Markus Koechl has a series of introductory articles, starting here - &lt;A href="https://blogs.autodesk.com/vault/2024/03/autodesk-vault-sdk-getting-started-1-installing-the-sdk/" target="_blank"&gt;https://blogs.autodesk.com/vault/2024/03/autodesk-vault-sdk-getting-started-1-installing-the-sdk/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The one you want is part 5, Login/Authorization Types - &lt;A href="https://blogs.autodesk.com/vault/2024/03/autodesk-vault-sdk-getting-started-5-login-authorization-types/" target="_blank"&gt;https://blogs.autodesk.com/vault/2024/03/autodesk-vault-sdk-getting-started-5-login-authorization-types/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This has a link to Markus' GitHub site - &lt;A href="https://github.com/koechlm/API-Onboarding-Sample--Vault-Logins" target="_blank"&gt;https://github.com/koechlm/API-Onboarding-Sample--Vault-Logins&lt;/A&gt; - which contains the sample code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll be interested in the file &lt;STRONG&gt;Form1.cs&lt;/STRONG&gt;, which contains all the login code. The simplest approach is to use the Vault login dialog, and the code for this is in the function &lt;STRONG&gt;button4_Click()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sample code is in C#, but should be easily converted to VB.NET. This site will do a pretty good job of converting it if you want to save yourself a few minutes -&amp;nbsp;&lt;A href="https://converter.telerik.com/" target="_blank"&gt;https://converter.telerik.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need any more help, let me know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;</description>
      <pubDate>Sun, 19 May 2024 21:17:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12783678#M881</guid>
      <dc:creator>Nick_Hall</dc:creator>
      <dc:date>2024-05-19T21:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Vault connection using API not working outside Inventor Addin solution project</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12785048#M882</link>
      <description>&lt;P&gt;Hi Nick&lt;/P&gt;&lt;P&gt;Very thorough help - thanks a lot! If I'm understanding correctly, all I need is to import "Autodesk.DataManagement.Client.Framework.Vault.Forms", and call "Forms.Library.Login(Nothing)".&lt;/P&gt;&lt;P&gt;This gets me the login dialog from Vault, but when I fill in my credentials, I get the error shown below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Skærmbillede 2024-05-20 161752.png" style="width: 470px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1364689iBE07C16D6158D6F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Skærmbillede 2024-05-20 161752.png" alt="Skærmbillede 2024-05-20 161752.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know what I'm missing?&lt;/P&gt;&lt;P&gt;/Anders&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 14:17:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12785048#M882</guid>
      <dc:creator>Anders_Olsen</dc:creator>
      <dc:date>2024-05-20T14:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Vault connection using API not working outside Inventor Addin solution project</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12785699#M883</link>
      <description>&lt;P&gt;Hi Anders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you are missing the licensing support DLLs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For 2024, these are AdskIdentitySDK.dll &amp;amp; AdskLicensingSDK_7.dll. If you are using another version check the SDK help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They need to be added to the project, and copied to the output folder. If you download &amp;amp; open the 2024 version of Markus's sample - &lt;A href="https://github.com/koechlm/API-Onboarding-Sample--Vault-Logins/tree/2024" target="_blank"&gt;https://github.com/koechlm/API-Onboarding-Sample--Vault-Logins/tree/2024&lt;/A&gt; - you will see this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 19:47:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12785699#M883</guid>
      <dc:creator>Nick_Hall</dc:creator>
      <dc:date>2024-05-20T19:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Vault connection using API not working outside Inventor Addin solution project</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12796594#M884</link>
      <description>&lt;P&gt;Eureka!!! It works beautifully! Thank you Nick!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To anyone else, interested, I'm using Vault 2023. I wasn't able to find any documentation reg. which licensing support dlls to use, but in my Vault SDK folder, I found "AdskLicensingSDK_6.dll". I couldn't find "AdskIdentitySDK.dll", but it seems to be working as expected only with the licensing file.&lt;/P&gt;&lt;P&gt;I would have expected the licensing support dll to get added as a reference, but this merely results in the following error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anders_Olsen_1-1716587917476.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1367211i2CB3D64351719072/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anders_Olsen_1-1716587917476.png" alt="Anders_Olsen_1-1716587917476.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What Markus's sample is showing is that the file resides directly under the project, so what I did was as follows:&lt;/P&gt;&lt;P&gt;First and foremost - follow&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7162092"&gt;@Nick_Hall&lt;/a&gt;'s explanations above. Then,&lt;/P&gt;&lt;P&gt;1. Find the relevant licensing dll file (in my case AdskLicensingSDK_6.dll".&lt;/P&gt;&lt;P&gt;2. Copy it to the project folder&lt;/P&gt;&lt;P&gt;3. Inside the solution, right click the project branch -&amp;gt; Add -&amp;gt; Existing Item...&lt;/P&gt;&lt;P&gt;4. Choose the dll&lt;/P&gt;&lt;P&gt;5. Rejoice!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7162092"&gt;@Nick_Hall&lt;/a&gt;, you've been a huge help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Anders&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 22:01:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/vault-connection-using-api-not-working-outside-inventor-addin/m-p/12796594#M884</guid>
      <dc:creator>Anders_Olsen</dc:creator>
      <dc:date>2024-05-24T22:01:05Z</dc:date>
    </item>
  </channel>
</rss>

