I think that will just delete the local copy of the file, not delete it from the vault. Here's the example code for deleting a file in EPDM, it's part of the API_GB.chm in C:\Program Files\SOLIDWORKS PDM
Dim vault2 As IEdmVault7 = Nothing
If vault1 Is Nothing Then
vault1 = New EdmVault5()
vault2 = DirectCast(vault1, IEdmVault7)
If Not vault1.IsLoggedIn Then
Dim pathList As EdmStrLst5
pathList = vault2.BrowseForFile(Me.Handle.ToInt32(), _
EdmBrowseFlag.EdmBws_ForOpen + _
EdmBrowseFlag.EdmBws_PermitVaultFiles + _
"", "", "", "", _
"Select Files to Delete")
If pathList Is Nothing Then Exit Sub
Dim pos As IEdmPos5
pos = pathList.GetHeadPosition
While Not pos.IsNull
Dim file As IEdmFile5
Dim folder As IEdmFolder5 = Nothing
file = vault2.GetFileFromPath(pathList.GetNext(pos), folder)
Dim strCount As String
strCount = pathList.Count.ToString
MessageBox.Show("Deleted " + strCount + " file")
Catch ex As System.Runtime.InteropServices.COMException
MessageBox.Show("HRESULT = 0x" + ex.ErrorCode.ToString("X") + " " + ex.Message)
Catch ex As Exception
Thank you very much.
I didn't know about ths help file.
I will give this a try and answer as soon as possible.
Charley is correct. Deleting the file via normal windows methods will only delete the local copy on whatever system the code is running on.
However, you may find it easier to do what you're trying to do via a dispatch action.
dispatch... as I am new to PDM and I only got the german frontend... where do I find the dispatch in german?
I have no Idea in which step I could find this.
Thank you in advance!
PS I've found the solution:
and then with this post: