-
Re: BatchGet - successfully completed?
Jim Sculley Sep 26, 2018 9:23 AM (in response to Sascha Smolny)You use GetFileList to determine the status of the various files that were part of the Get operation, passing in the appropriate EdmGetFileListFlag enumerarion value:
EdmSelectionList5 selList = batchGet.GetFileList((int)EdmGetFileListFlag.Egflf_GetRetrieved); //Files successfully retrieved //Process files here selList = batchGet.GetFileList((int)(EdmGetFileListFlag.Egflf_GetFailed | EdmGetFileListFlag.Egflf_GetUnprocessed)); //Files that failed or were not processed //Process files here
-
Re: BatchGet - successfully completed?
Sascha Smolny Sep 26, 2018 10:06 AM (in response to Jim Sculley)Hello,
many thanks for your Answer. But I can not handle that...
If i use the ShowDlg and check all files i get "EdmGetFileListFlag.Egflf_GetRetrieved" with all the files. And no errors.
If i only let the selection as is i get:
Egflf_GetFailed 7
Egflf_GetLocked 0
Egflf_GetRetrieved 1
Egflf_GetUnprocessed 22
In the Dialog are:
3 Drawing Files selected (without warnings)
7 Files had warnings
22 not checked
If i get the FileListFlags before i use the GetFiles method i get the same result. So i think i had to check every time all files to check if all are ok?
Regards
Sascha
-
Re: BatchGet - successfully completed?
Jim Sculley Sep 26, 2018 10:44 AM (in response to Sascha Smolny)Can you post a screen shot of your PDM task pane tree and the dialog shown by ShowDlg?
-
Re: BatchGet - successfully completed?
Tim Webb Sep 26, 2018 10:51 AM (in response to Sascha Smolny)Sascha,
Jim is providing the right assistance you need but his code is in C#. You can convert it to vb.net using the Terelik converter
Dim selList As EdmSelectionList5 = batchGet.GetFileList(CInt(EdmGetFileListFlag.Egflf_GetRetrieved))
selList = batchGet.GetFileList(CInt((EdmGetFileListFlag.Egflf_GetFailed Or EdmGetFileListFlag.Egflf_GetUnprocessed)))
-
-
-
Re: BatchGet - successfully completed?
Sascha Smolny Sep 26, 2018 11:04 AM (in response to Sascha Smolny)Hello,
thanks Tim for the Tip but converting code from C# is no problem for me.
Here is a screenshot of the Dialog (Sorry...in German language):
I did not open the Files in SolidWorks. So i cant make a screenshot of the TaskPane Tree.
My current idea (if the other will not work):
Get the fileList and check manually the versions. (Unfortunately, I am not ready yet)
fileList = batchGetter.GetFileList(EdmGetFileListFlag.Egflf_GetLocked & EdmGetFileListFlag.Egflf_GetFailed & EdmGetFileListFlag.Egflf_GetRetrieved & EdmGetFileListFlag.Egflf_GetUnprocessed)
Dim poSel As EdmSelectionObject
aPos = fileList.GetHeadPosition()
poSel = Nothing
While Not (aPos.IsNull())
fileList.GetNext2(aPos, poSel)
If poSel.mlGetVersion <> poSel.mlLocalVersion Then
'MsgBox(poSel.mbsPath)
End If
End While
So i get only one Drawing that is not in the right verison...
Regards
Sascha
-
Re: BatchGet - successfully completed?
Sascha Smolny Sep 27, 2018 2:06 AM (in response to Sascha Smolny)Hello,
i have found a option to get a message if the operation is not successful.
First i have created the Class EdmGetOpCallback
Class EdmGetOpCallback Implements IEdmGetOpCallback Public Property HasErrors As Boolean = False Public Sub LogMessage(eMsgID As EdmGetOpMsg, hCode As Integer, bsDetails As String) Implements IEdmGetOpCallback.LogMessage 'Throw New NotImplementedException() End Sub Public Sub ProgressBegin(eType As EdmProgressType, lSteps As Integer) Implements IEdmGetOpCallback.ProgressBegin 'Throw New NotImplementedException() End Sub Public Sub ProgressEnd(eType As EdmProgressType) Implements IEdmGetOpCallback.ProgressEnd 'Throw New NotImplementedException() End Sub Public Function ConfirmReplace(eReason As EdmGetConfirmReason, bsPath As String) As Boolean Implements IEdmGetOpCallback.ConfirmReplace 'Throw New NotImplementedException() Return False End Function Public Function ProgressStep(eType As EdmProgressType, bsMessage As String, lProgressPos As Integer) As Boolean Implements IEdmGetOpCallback.ProgressStep 'Throw New NotImplementedException() Return True End Function Public Function ReportFailure(lFileID As Integer, bsPath As String, hError As Integer, bsDetails As String) As Boolean Implements IEdmGetOpCallback.ReportFailure 'Throw New NotImplementedException() HasErrors = True Return False 'False = nicht weiter machen! End Function End Class
I have only added
Public Property HasErrors As Boolean = False
and in the ReportFailure Function:
HasErrors = True Return False
Return False is to abort the operation on errors.
So can i use it:
Dim CB As New EdmGetOpCallback batchGetter.GetFiles(Me.Handle, CB) If CB.HasErrors = True Then MsgBox("Error found!") End If
If a File is locked I get the Error: "Operation wurde vom Benutzer abgebrochen." (Operation canceled by user). No clue why...but it seems to work (i want only get a error if something unexpected happened.
See edit! If a File is locked i get the right Error Message!
I hope that this works as desired.
My other Idea will not work:
fileList = batchGetter.GetFileList(EdmGetFileListFlag.Egflf_GetLocked & EdmGetFileListFlag.Egflf_GetFailed & EdmGetFileListFlag.Egflf_GetRetrieved & EdmGetFileListFlag.Egflf_GetUnprocessed)
Gives me not all Files. If a File is locked the File is not in the fileList. So i can not check it.
[edit] If i use "batchGetter.FileCount" i get more Files (in my example 25) as the fileList count (22 Files). So 3 Files are not ok. It seems that drawings from contained Assemblys not be fetched. But they are displayed in the dialog (???). [/edit]
Is there a possibility to get the Files that have a "Stop" reason? (Locked by another user, open in other application...)
Regards
Sascha
[EDIT]
I have found that no data has been copied if i use the EdmGetOpCallback
It is very important to return true in ProgressStep function:
Public Function ProgressStep(eType As EdmProgressType, bsMessage As String, lProgressPos As Integer) As Boolean Implements IEdmGetOpCallback.ProgressStep 'Throw New NotImplementedException() Return True End Function
Than it worked as expected.
[/Edit]
n = SoFals