Use Inventor Vault Add-in through Inventor API

Use Inventor Vault Add-in through Inventor API

b.graaf
Advocate Advocate
7,464 Views
22 Replies
Message 1 of 23

Use Inventor Vault Add-in through Inventor API

b.graaf
Advocate
Advocate

 

Is it possible with the Inventor API to:

- check, if the user has logged into Vault (Inventor Vault add-in)

- if not, to open the Vault login screen

- if yes, to use the Inventor Vault add-in

 

Actually, I am trying to do the following thing:

- I would like to get a list with the files in teh Vault. I would like to get this list through the Inventor API.

 

Is this possible?

0 Likes
Accepted solutions (1)
7,465 Views
22 Replies
Replies (22)
Message 2 of 23

smilinger
Advisor
Advisor

In your project add references to:

 

C:\Program Files (x86)\Autodesk\Autodesk Vault 20XX SDK\bin\Autodesk.DataManagement.Client.Framework.Vault.dll

C:\Program Files\Autodesk\Inventor 20XX\Bin\Connectivity.InventorAddin.EdmAddin.dll

 

In your code:

 

using Connectivity.InventorAddin.EdmAddin;
using VDF = Autodesk.DataManagement.Client.Framework.Vault;

......

void DoSomething()
{
        EdmSecurity edmSecurity = EdmSecurity.Instance;
        VDF.Currency.Connections.Connection connection = edmSecurity.VaultConnection;

        if (edmSecurity.IsSignedIn())
        {
            MessageBox.Show("Vault signed in!");
        }

        ......
}
Message 3 of 23

smilinger
Advisor
Advisor

Login with Inventor:

 

using Connectivity.InventorAddin.EdmAddin;
using VDF = Autodesk.DataManagement.Client.Framework.Vault;

......

void DoSomething()
{
    EdmSecurity edmSecurity = EdmSecurity.Instance;
    if (edmSecurity.IsSignedIn())
    {
        MessageBox.Show("Already signed in!");
    }
    else
    {
        _inventorApplication.CommandManager.ControlDefinitions["LoginCmdIntName"].Execute();
    }
VDF.Currency.Connections.Connection connection = edmSecurity.VaultConnection; if (connection != null) { //...... } }
Message 4 of 23

b.graaf
Advocate
Advocate

Tnx, I will give that a try!

0 Likes
Message 5 of 23

wayne.brill
Collaborator
Collaborator

Hi,

 

In reply to this:

"I would like to get a list with the files in teh Vault. I would like to get this list through the Inventor API"

 

You could use the Vault API from an Inventor Add-In to get files in a vault but the Inventor API does not have any methods to access anything in a Vault . 

 

Also:

There is not any API for the Inventor Vault Add-In and the Vault API does not support checking in new assemblies.

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 6 of 23

C-Hoppen
Advocate
Advocate

Hello,

 

the example does not work for me. edmSecurity.IsSignedIn() is always false and edmSecurity.VaultConnection returns null.

I have Inventor 2017 running and I'm connected to a Vault 2018 Prof. Server.

 

Any ideas why this doesn't work?

 

Thanks,

Christoph

 

0 Likes
Message 7 of 23

bradeneuropeArthur
Mentor
Mentor
Die uou make the reference to the edmaddin correctly?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

0 Likes
Message 8 of 23

bradeneuropeArthur
Mentor
Mentor
Did you make the reference correctly?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

0 Likes
Message 9 of 23

C-Hoppen
Advocate
Advocate

bradeneurope,

 

please have a look at my attached vc# project.

What do mean with "referenced correctly"? Any references missing would throw an exception.

 

Regards,

Christoph

0 Likes
Message 10 of 23

bradeneuropeArthur
Mentor
Mentor
Are you using the vault 2018 api reference?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

0 Likes
Message 11 of 23

bradeneuropeArthur
Mentor
Mentor
I am not able to take a look at the zip file right now.
Later I will take a look.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

0 Likes
Message 12 of 23

C-Hoppen
Advocate
Advocate

@bradeneuropeArthur wrote:
Are you using the vault 2018 api reference?

No, all references are 2017.

0 Likes
Message 13 of 23

bradeneuropeArthur
Mentor
Mentor
Thst can be the problem I think. Use the 2018 refs. Or give this I try.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

0 Likes
Message 14 of 23

C-Hoppen
Advocate
Advocate

I changed all Refs to 2018. No difference. Still no connection.

 

Christoph

 

Snippet

using System;
using System.Windows.Forms;
 
// C:\Program Files\Autodesk\Inventor 2017\Bin\...
// Autodesk.DataManagement.Addin.Framework.dll
// Autodesk.DataManagement.Addin.Vault.dll
// Connectivity.Common.dll
// Connectivity.InventorAddin.EdmAddin.dll
// C:\Program Files (x86)\Autodesk\Autodesk Vault 2017 SDK\bin\x64\Autodesk.DataManagement.Client.Framework.Vault.dll
// C:\Program Files\Autodesk\Inventor 2017\Bin\Public Assemblies\Autodesk.Inventor.Interop.dll
 
using Connectivity.InventorAddin.EdmAddin;
using VDF = Autodesk.DataManagement.Client.Framework.Vault;
 
namespace VaultLoginTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                Inventor.Application invApp = System.Runtime.InteropServices.Marshal.GetActiveObject
                    ("Inventor.Application") 
                    as Inventor.Application;
 
                EdmSecurity edmSecurity = EdmSecurity.Instance;
                if (edmSecurity.IsSignedIn()) // ---------------------- is always false
                {
                    MessageBox.Show("Already signed in!");
                }
                else
                {
                    invApp.CommandManager.ControlDefinitions["LoginCmdIntName"].Execute();
                }
 
                VDF.Currency.Connections.Connection connection = edmSecurity.VaultConnection; // returns always null
                if (connection != null)
                {
                    //......
                }
 
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}

 

0 Likes
Message 15 of 23

bradeneuropeArthur
Mentor
Mentor
You need first to sign in. Using the edm user. Vault. Password. Server etc.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

0 Likes
Message 16 of 23

C-Hoppen
Advocate
Advocate

I'm logged in to the vault server. I want to use the loggin from Inventors Vault AddIn. It should be done at least by calling

Snippet

...
else
{ invApp.CommandManager.ControlDefinitions["LoginCmdIntName"].Execute(); }

 which works fine.

But calling edmSecurity.VaultConnection after that returns always null.

 

I also tried 

Snippet

VDF.Currency.Connections.Connection connection = Connectivity.Application.
    VaultBase.ConnectionManager.
           Instance.Connection;

as descriped here:

 

http://adndevblog.typepad.com/manufacturing/2013/09/autocad-2014-vault-add-in-connection.html

 

without success - connection is always null.

 

Regards,

Christoph

0 Likes
Message 17 of 23

bradeneuropeArthur
Mentor
Mentor
I will send you an example what worked by me.
Ok?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

0 Likes
Message 18 of 23

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Hi,

 

This is the method to reuse the loggin settings for the vault add-in.

Imports Connectivity.InventorAddin.EdmAddin
	 
	 Public Sub SetupUserInterface(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean, ClientID As String)
			
			' rest of the code should be left in here for the setupUserInterface
			'to get connection you should use the edmAddin ServerName Vault Name and username with the password you have logged in with.			
            If firstTime And...................................................................		
			
Dim strVaulrServerName As String = Connectivity.InventorAddin.EdmAddin.EdmSecurity.Instance.GetEdmLoginPreferences.Server Dim strVaultName As String = Connectivity.InventorAddin.EdmAddin.EdmSecurity.Instance.GetEdmLoginPreferences.VaultName Dim strVaultUserName As String = Connectivity.InventorAddin.EdmAddin.EdmSecurity.Instance.GetEdmLoginPreferences.UserName Dim strVaultPassword As String = Connectivity.InventorAddin.EdmAddin.EdmSecurity.Instance.GetEdmLoginPreferences.Password Dim results As VDF.Vault.Results.LogInResult results = VDF.Vault.Library.ConnectionManager.LogIn(strVaulrServerName, strVaultName, strVaultUserName, strVaultPassword, VDF.Vault.Currency.Connections.AuthenticationFlags.Standard, Nothing) Dim conn As VDF.Vault.Currency.Connections.Connection = Nothing If results.Success Then conn = results.Connection End If end sub

Some time is required to setup the vault connections so it could be possible that the connection was nul because the connection was not ready.

 

 

Let me know if it works.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

Message 19 of 23

C-Hoppen
Advocate
Advocate

Thanks for your snippet! The magic word was "addInSiteObject"...

I tested all the code snippets in an "stand alone" application which runs out-of-process and that's why all properties were empty.

Now I tested the code in an Inventor AddIn and all snippets are working fine.

Thanks again for help.

Christoph 

 

 

0 Likes
Message 20 of 23

bradeneuropeArthur
Mentor
Mentor
Could you please mark it as solved then!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
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:
My 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 !


 


EESignature

0 Likes