Vault communication Visual Studio and excel

Vault communication Visual Studio and excel

beyEZWUB
Participant Participant
374 Views
3 Replies
Message 1 of 4

Vault communication Visual Studio and excel

beyEZWUB
Participant
Participant

Hi all, I've been looking for some VB.net code for quite some time and just can't find anything suitable.

The goal is to match the names from an Excel column with files in the Vault. They are located in a certain folder.
If it finds them just retrieve them.

 

Now the problem:
The integration of the .DLL from autodesk vault which is needed for this communication does not work somehow.

I had tried it  over the VBA console in Inventor but there the .DLL can't integrated either. Therefore the detour over visual Studio.

 

I hope someone has an idea and can help me out of the complete perplexity.

Thanks in advance.

0 Likes
375 Views
3 Replies
Replies (3)
Message 2 of 4

Chancellor.Kurre
Advocate
Advocate

This looks like something that can be handled in PowerShell. I use a module called powerVault that makes connecting to Vault pretty straightforward. You can also use ImportExcel to deal with the excel file. Happy to answer any questions about this approach if needed!

Message 3 of 4

beyEZWUB
Participant
Participant

Good morning, I'm trying to resolve the problem without using an external program. I found a helpful lecture which can be very interesting for someone who has faced the same issue.

 

https://www.autodesk.com/autodesk-university/class/Feel-Power-Between-Vault-and-PowerShell-2019

 

It's really a difficult matter:)

0 Likes
Message 4 of 4

beyEZWUB
Participant
Participant
This code should be check the connection status from vault. 
I found out that all rows are linked with $serviceManager produce this 
Errormessage:
New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "301"
 
I follow the iinstructions from the video and put the "gatekeeper" in the right directory and install the sdk 
 
[System.Reflection.Assembly]::LoadFrom('C:\Program Files\Autodesk\Autodesk Vault 2022 SDK\bin\x64\Autodesk.Connectivity.WebServices.dll')
[System.Reflection.Assembly]::LoadFrom('C:\Program Files\Autodesk\Autodesk Vault 2023 SDK\bin\x64\Autodesk.DataManagement.Client.Framework.dll')
[System.Reflection.Assembly]::LoadFrom('C:\Program Files\Autodesk\Autodesk Vault 2023 SDK\bin\x64\Autodesk.Connectivity.WebServices.WCF.dll')
[System.Reflection.Assembly]::LoadFrom('C:\Program Files\Autodesk\Autodesk Vault 2023 SDK\bin\x64\Autodesk.DataManagement.Client.Framework.Vault.dll')

 

$serverIdentities = New-Object Autodesk.Connectivity.WebServices.ServerIdentities
$serverIdentities.DataServer = "adress"
$serverIdentities.FileServer = "adress"

 

$VaultName = "Vaultname"
$Username = "Name"
$password = "password"

 

$licenseType = [Autodesk.Connectivity.WebServices.LicensingAgent]::Server

 

$userPasswordCredentials = New-Object Autodesk.Connectivity.WebServicesTools.UserPasswordCredentials(
   $serverIdentities, "Vault", "Administrator", "", $licenseType)

 

$serviceManager = New-Object Autodesk.Connectivity.WebServicesTools.WebServiceManager($userPasswordCredentials)

 

Write-Output($serviceManager.ReplicationService.GetlocalWorkgroup())
Write-Output($serviceManager.InformationService.GetServerName())
Write-Output($serviceManager.InformationService.GetSystemProducts())
 
$serviceManager.Dispose()
 
 
When I comment out all the lines with $serviceManager, no error message appears.
 
I use also Visual Studio Code with Powershell extension.  
 
 
0 Likes