AnsweredAssumed Answered

BatchGet - successfully completed?

Question asked by Sascha Smolny on Sep 26, 2018
Latest reply on Sep 26, 2018 by Sascha Smolny



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) '

               'I dont want to show the Dialog


             batchGetter.GetFiles(Me.Handle, Nothing)


The GetFiles method is a void method. But on the API-Help Page are returns specified:

Return codes:

  • 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?