Having issues with EPDM API that are boggling:
Here's a snippit:
' get the source file
aFile = vault.GetFileFromPath("C:\PDM_Vault\old_file.sldprt")
aPos = aFile.GetFirstFolderPosition
aFolder = aFile.GetNextFolder(aPos)
' copy the file to a new filename in the same folder
bfileID = aFolder.CopyFile(aFile.ID, aFolder.ID, Me.Handle.ToInt32(), "new_file.sldprt", 0)
bfile = vault.GetFileFromPath("C:\PDM_Vault\new_file.sldprt")
' eveything seems to look like it's working
' got both afile and bfile
' got both id's
' file appears to be in the vault (in windows explorer in Private state)
'now let's check it in
bfile.UnlockFile(Me.Handle.ToInt32(), "Copy of original file")
This last statement throws an error:
E_EDM_FILE_NOT_FOUND 0x80040213 The file could not be found
Anybody got any advice? I'm at my wits end...
Try adding the bit flag EdmUnlock_IgnoreRefsOutsideVault (8) to the UnlockFile method.
bfile.UnlockFile(Me.Handle.ToInt32(), "Copy of original file", 8)
Retrieving data ...