5 Replies Latest reply on Oct 5, 2017 4:54 PM by Steve Anderson

    Batch Check Out

    Steve Anderson

      Hello:

      I am looking at this specific example in the SolidWorks help files.  The application pertains to API programming for PDM 2017 SP4.1.

       

      http://help.solidworks.com/2017/english/api/epdmapi/Batch_Get_Files_Example_VBNET.htm

       

      At the very end of the example, I have added a few lines of code:

       

                     If (retVal) Then

                         batchGetter.GetFiles(Me.Handle.ToInt32(), Nothing)

                     End If

      end of example above

      lines added below

                     ' We need a delay

                     For c As Integer = 1 To 10

                         MessageBox.Show(c.ToString)

       

                     Next

       

                     Dim enumVarObj2 As IEdmEnumeratorVariable8 = aFile.GetEnumeratorVariable

                     SetReviewer(enumVarObj2, 1)

                     MessageBox.Show("Done...")

       

                 End If

       

      The gist of things is that the example above does a batch check out.  The next step is to transition to updating some values on the card below.  If I check the file out manually, the card update logic works great.  However, it seems there must be some kind of refresh required because when I try to combine the functionality it thinks the file is still checked in and thus will not update the card.  I added the delay, and I wait until it is confirmed checked out, however the logic still fails.

       

      Let me know if you have any thoughts.

       

      Thanks,

       

       

      Steve Anderson

        • Re: Batch Check Out
          Steve Anderson

          So the issue here is that there is a bug in the API that has not been fixed until 2018.

          • Re: Batch Check Out
            Lee CS Young

            I don't recall seeing an issue with this. Have you added the Egcf_RefreshFileListing flag when you call CreateTree?

              • Re: Batch Check Out
                Steve Anderson

                Lee:

                 

                The code is identical to the example, except that this is added at the end in an attempt to update the card value.

                                ' We need a delay

                                For c As Integer = 1 To 10

                                    MessageBox.Show(c.ToString)

                 

                                Next

                                vault2.RefreshFolder(OpenFileDialog1.FileName)

                 

                              Dim enumVarObj2 As IEdmEnumeratorVariable8 = aFile.GetEnumeratorVariable

                              SetReviewer(enumVarObj2, 1)

                              MessageBox.Show("Done...")

                 

                And the SetReviewer function looks like this:

                 

                    Public Sub SetReviewer(ByVal vars As IEdmEnumeratorVariable8, ByVal num As String)

                        Dim Value As String = "Yes"

                        vars.SetVar("Description", "", Value)

                        vars.CloseFile(True)

                 

                 

                    End Sub

                 

                Basically, in this example I am adding the card value for the Description (this is a test), but it will not do it.  As I understand it, the system believes the file is not checked out yet, even though I verify this ahead of time. in my For c loop prior to clicking through the loop.  I thought perhaps some kind of refresh might do it, but no go.  

                 

                You are now mentioning this: Egcf_RefreshFileListing flag when you call CreateTree?  Is there some specific syntax I can follow for this?

                 

                Thanks,

                 

                 

                Steve Anderson