Have a look at the IEdmVault5.RootFolderPath property.
No, currently i'm using
Dim assyC As String
Dim assyD As String
Dim assyE As String
'then sending it to
assyC = "C:\Vault\standards\block\RV_ASMC.sldblk"
assyD = "C:\Vault\standards\block\RV_ASMD.sldblk"
assyE = "C:\Vault\standards\block\RV_ASME.sldblk"
FYI, this is a VB macro being run within solidworks.
My problem is not all users will have the vault on their "c" drive
You will want every user to have the vault on the same path. You're just asking for headaches if you don't.
I have been using C:\Vault Views\<vault> as the root for everyone.
I agree 100%, however; IT defines what drive they install the vault onto in each workstation. We are slowly converting from c to d drive due to IT now installing the Vault onto newly installed secondary Solid State Drives.
This is a slow process and foresee a few years till everyone is on the same drives...
I'm trying to get a workaround.
Gotta love it when they get involved.
I agree, but it has it good points too...(NOT many tho)
You could use something like this in your macro. Don't forget to add the reference to the PDM Type Library.
Dim vault As Object Dim vaultRootFolderPath As String Sub LoginToVault() Dim strVaultName As String strVaultName = "YOURVAULTNAME" Set vault = CreateObject("ConisioLib.EdmVault") vault.LoginAuto strVaultName, 0 If vault.IsLoggedIn Then vaultRootFolderPath = vault.RootFolderPath End If End Sub
Otherwise, you could read the registry to get the root. (HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\Applications\PDMWorks Enterprise\Databases\YOURVAULT)
Lee, i ended up inserting & tweaked some other code (below) i had found and it works flawlessly now.
Dim conn As EdmVault5
Set conn = New EdmVault5
Dim vaultName As String
vaultName = InputBox("Enter vault name:")
Call conn.LoginAuto(vaultName, 0)
MsgBox "Vault root folder: " & vbCrLf & conn.RootFolderPath
Thanks for all the help