Greetings!
I've copied/written the code below which works fine on a VMware 64-Bit 'full-machine' w/ SolidWorks Explorer installed.
When I copy the program over to a VMware 64-Bit Virtual Sierver w/ Solidworks Explorer installed, the GetLocalVersionNo command returns a -1 and the code fails.
Can you point me in the right direction?
<p> IEdmVault5 vault1 = new EdmVault5();</p><p> if (vault1 == null)</p><p> {</p><p> vault1 = new EdmVault5();</p><p> }</p><p> if (!vault1.IsLoggedIn)</p><p> {</p><p> //Log into selected vault as the current user</p><p> vault1.LoginAuto("SLMP-Sparta", Handle.ToInt32());</p><p> }</p><p></p><p></p><p> string rootPath1 = vault1.RootFolderPath;</p><p></p><p></p><p> // Get the File</p><p> IEdmVault7 vault2 = null;</p><p> if (vault1 == null)</p><p> {</p><p> vault1 = new EdmVault5();</p><p> }</p><p> vault2 = (IEdmVault7)vault1;</p><p> if (!vault1.IsLoggedIn)</p><p> {</p><p> //Log into selected vault as the current user</p><p> vault1.LoginAuto("SLMP-Sparta", Handle.ToInt32());</p><p> }</p><p></p><p></p><p> string rootPath2 = vault2.RootFolderPath;</p><p></p><p></p><p></p><p></p><p> // Get a Handle on the File</p><p> IEdmFile9 aFile = default(IEdmFile9);</p><p> IEdmFolder5 ppoRetParentFolder;</p><p> </p><p> string strPartNumber = readMATRIX["ITEM_CODE"].ToString();</p><p> </p><p> // For Debugging</p><p> strPartNumber = "32061-0348.pdf";</p><p></p><p></p><p> aFile = (IEdmFile9)vault2.GetFileFromPath(rootPath1 </p><p> + @"\\Material Inventory Prints\\" + strPartNumber, out ppoRetParentFolder);</p><p></p><p></p><p> </p><p> // If the file was found, continue</p><p> if (aFile != null)</p><p> {</p><p> string saveFileName = @"C:\\Temp\\" + aFile.Name;</p><p></p><p></p><p> // Delete the C:\\Temp\\ version if it exists</p><p> if (System.IO.File.Exists(saveFileName))</p><p> {</p><p> System.IO.File.Delete(saveFileName);</p><p> }</p><p></p><p></p><p> // Find the latest version and save it to C:\\Temp\\</p><p> IEdmEnumeratorVersion5 verEnum;</p><p> verEnum = (IEdmEnumeratorVersion5)aFile;</p><p> </p><p> int intVersion = 0;</p><p> intVersion = aFile.GetLocalVersionNo(ppoRetParentFolder.ID);</p><p> </p><p> IEdmVersion5 ver;</p><p> </p><p> ver = verEnum.GetVersion(intVersion);</p><p> ver.GetFileCopy(Handle.ToInt32(), saveFileName, 0);</p>Thanks!
SolidworksApi macros