Hello,
I'm going to write a macro to get the files of an assembly in the version as created. I use EdmUtil_BatchGet for this.
It works pretty well, but i have no idea how to check if all files have been copied successfully. If i have one file locked by an SolidWorks session this File can not be copied but i do not get an error message.
My Code:
Dim batchGetter As IEdmBatchGet
batchGetter = vault.CreateUtility(EdmUtility.EdmUtil_BatchGet)
Dim aFile As IEdmFile5 = vault.GetFileFromPath("C:\\PDM\\BG\\bg 00414.SLDASM")
Dim Item As New EdmSelItem
Item.mlDocID = aFile.ID
Dim aPos As IEdmPos5 = aFile.GetFirstFolderPosition
Item.mlProjID = aFile.GetNextFolder(aPos).ID
Dim Items(0) As EdmSelItem
Items(0) = Item
batchGetter.AddSelection(vault, Items)
batchGetter.CreateTree(Me.Handle, 1) 'http://help.solidworks.com/2015/English/api/epdmapi/EPDM.Interop.epdm~EPDM.Interop.epdm.EdmGetCmdFlags.html
'I dont want to show the Dialog
'batchGetter.ShowDlg(Me.Handle)
batchGetter.GetFiles(Me.Handle, Nothing)
The GetFiles method is a void method. But on the API-Help Page are returns specified:
- S_OK: The method successfully executed.
- S_FALSE: One of the arguments is invalid.
How to use these? Or how can i test if all files where successfully transferred?
Regards
Sascha
SolidworksSolidworks Pdm/enterprise Pdm