Can you query the current vault user?

Can you query the current vault user?

mslosar
Advisor Advisor
1,686 Views
15 Replies
Message 1 of 16

Can you query the current vault user?

mslosar
Advisor
Advisor

Is there any method for doing this inside Inventor? I switch back and forth from basic user to admin and there are times you forget which one was which, etc.

 

I'd just like a way to determine which user i'm presently logged in with WITHOUT having to log out and back in.

0 Likes
Accepted solutions (1)
1,687 Views
15 Replies
Replies (15)
Message 2 of 16

bradeneuropeArthur
Mentor
Mentor
What version of vault are you using.
And yes that is possible

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 3 of 16

mslosar
Advisor
Advisor

We're on 2017 on both inventor and vault.

 

Should be moving to '19 this summer.

0 Likes
Message 4 of 16

bradeneuropeArthur
Mentor
Mentor
vault pro?

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 5 of 16

bradeneuropeArthur
Mentor
Mentor
Accepted solution

See this simular solution.

https://forums.autodesk.com/t5/inventor-customization/use-inventor-vault-add-in-through-inventor-api...

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 6 of 16

mslosar
Advisor
Advisor

Looks like it should work rather simply with the vb excerpt at the bottom. I'll give it a whirl and let you know, thanks 🙂

0 Likes
Message 7 of 16

bradeneuropeArthur
Mentor
Mentor
I can provide you the code next week. About the user that is logged in.

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 16

mslosar
Advisor
Advisor

I think i'm missing a reference...not sure. It won't let me use 

Imports Connectivity.InventorAddin.EdmAddin

 

Says Connectivity is not declared.

 

I've added that and Autodesk.DataManagement.Client.Framework.Vault.dll to the reference manager.

 

Is it an issue i had to browse to them instead of them popping up in the list?

0 Likes
Message 9 of 16

mslosar
Advisor
Advisor

All right.

 

I think something is misconfigured. I found a post on it that showed someones list of references. I've got all those added and same error with Connectivity is not declared.

 

If i try and type in the Imports line, i don't get sub choices of Autodesk or Connectivity, my list is:

<namespace alias>

<xmlns>

Inventor

Microsoft

Stdole

System

My Project

 

 

 

 

 

0 Likes
Message 10 of 16

bradeneuropeArthur
Mentor
Mentor
C:\Program Files\Autodesk\Inventor 20xx\Bin\Autodesk.DataManagement.Client.Framework.Vault.dll

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 16

bradeneuropeArthur
Mentor
Mentor
I have this working for an inventor add in.
So I don't use stand alone apps.
Create a new inventor add in and paste the code in there. Or provide the add in code and I will add the needed code.....

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 16

mslosar
Advisor
Advisor

This is an add-in as well.

 

I figured out the problem of why the connectivity wasn't working. .Net Framework.

 

I've been adding to this add-in suite of mine for years. It was written originally under .Net 3.5. The trick in getting it to work was to up it to 4.5. That fixed those errors and got it working. And all i needed was rather simple in the end:

Public Sub WhoIsMe(ThisApplication As Inventor.Application)
        
       
        Dim strVaultUserName As String = Connectivity.InventorAddin.EdmAddin.EdmSecurity.Instance.GetEdmLoginPreferences.UserName
       

        MsgBox(strVaultUserName, MsgBoxStyle.Information, "Vault User Logged In")

       
    End Sub

That will simplify my life a lot 🙂

 

However the update to .Net 4.5 gives me warnings now.  Not exactly sure how to fix them. Any ideas?

Conflicts.PNG

Message 13 of 16

bradeneuropeArthur
Mentor
Mentor
You are using a older interop?

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 16

mslosar
Advisor
Advisor

I went into the references and turned the flag to false on the interop and those 3 went away.

 

Now if i could figure out what was referencing the same dependent stuff, that would help. If it knows there's a conflict, you'd think it could tell you what's doing the conflicting.

0 Likes
Message 15 of 16

mslosar
Advisor
Advisor

Why does this work under vb but not c#?

 

When i try and use it it says: EdmSecurity.GetEdmLoginPreferences() is a method, which is not valid in the available context.

 

All the same references are set as well as the using statement.

0 Likes
Message 16 of 16

mslosar
Advisor
Advisor

Looks like the 2019 version changed.

This works:

 

EdmSecurity test = Connectivity.InventorAddin.EdmAddin.EdmSecurity.Instance;

MessageBox.Show(test.VaultConnection.UserName);

0 Likes