AnsweredAssumed Answered

Get vault for file

Question asked by Jorn Bjarning on Oct 14, 2019
Latest reply on Oct 14, 2019 by Amen Allah Jlili

This sounds so basic that I can't believe I am asking, but anyway...

 

I am creating a SOLIDWORKS add-in, which is going to get the latest released version from PDM Pro of the active part/assembly/drawing in SOLIDWORKS.

 

Initially I am using this to get access to the vault (VB):

 

Dim Vault1 As IEdmVault5 = New EdmVault5
Vault1.LoginAuto("VaultName", Nothing)

 

But how to avoid hard coding the vault name into the application? The application should work with any vault. The user has a model/assembly/drawing open in SOLIDWORKS - so I know the path of the file. The file is located in a vault. The main question is: Is there anyhow I can get the name of the vault the file is located in? A user might have multiple vault views. I can think of this (clumpsy) method:

 

  1. Get the names of the vault views on the machine with: vault.GetVaultViews
  2. For each of the vault view names - look in the path of the file to see if the vault view name is in the path

 

As I said I believe it is clumpsy and also not bullet proof.

Outcomes