Hello
Here is the test code that works perfectly for me:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Dim Vault As New EdmVault5
Dim File As IEdmFile5
Dim Folder As IEdmFolder5
Vault.LoginAuto "Coffre_BE", 0
Set File = Vault.GetFileFromPath("C:\Coffre_BE\TEST\0088880001.SLDPRT", Folder)
Set Part = swApp.OpenDoc6(Folder.LocalPath & "/" & File.Name, 1, 2, "", longstatus, longwarnings)
swApp.ActivateDoc2 File.Name, False, longstatus
Set swModel = swApp.ActiveDoc
swModel.ViewZoomtofit2
End Sub
For the file path, it's normal for it to be like a local file because it's the one from the local view of the vault, I'm just surprised that this view is in SOLIDWORKS Data.
To compensate for a possible difference in the position of the vault view between the different stations, you can start from your code, search for the vault view and then call your file path starting with Vault.rootfolder.localpath, for example:
vault1. RootFolder.LocalPath + \TEST\0088880001.SLDPRT"
example of finding vault views in C# and then connecting:
vault1 = new EdmVault5();
IEdmVault8 vault = (IEdmVault8)vault1;
EdmViewInfo[] Views = null;
Vault. GetVaultViews(out Views, false);
comboBox1.Items.Clear();
foreach (EdmViewInfo View in Views)
{
comboBox1.Items.Add(View.mbsVaultName);
}
if (comboBox1.Items.Count > 0)
{
comboBox1.Text = (string)comboBox1.Items[0];
}
if (!vault1. IsLoggedIn)
{
vault1. LoginAuto(comboBox1.Text, this. Handle.ToInt32());
}
Kind regards