Check In Multiple Files - Best Practice?

Check In Multiple Files - Best Practice?

Boorda
Advocate Advocate
4,158 Views
4 Replies
Message 1 of 5

Check In Multiple Files - Best Practice?

Boorda
Advocate
Advocate

As the title suggests, what would be the best practice for checking in thousands of renamed files? I've searched all over the net and handling multiple file check-ins is not really discussed, only single file check-ins.

 

With Acquiring files we are able to nicely add to the AcquireFilesSettings using the .AddFileToAcquire method to download many files, but whats the check-in version of that? How does the Vault addin for Inventor handle this?

 

Reason I ask is because I'm finding my self getting one of several errors...

1021 "CheckoutAlreadyCheckedOut" <

1103 "CheckinFailedAssociatedFileCheckedout" 

or file in use by another process.

 

I should mention I am multi threading my check-in to try and speed things up, but clearly I'm running into collisions with other threads before they can finish.

I've even tried starting with .ipt -> .iam -> .idw, but still no luck. 

 

Just for reference here is how I'm acquiring files...

    Private Function AcquireFiles() As Boolean
        Try

            'Setup the acquire options.
            Dim Settings As New AcquireFilesSettings(VConn)

            With Settings
                .OptionsRelationshipGathering.FileRelationshipSettings.VersionGatheringOption = VersionGatheringOption.Latest
                .OptionsRelationshipGathering.FileRelationshipSettings.IncludeChildren = True
                .OptionsRelationshipGathering.FileRelationshipSettings.RecurseChildren = True
                .OptionsResolution.OverwriteOption = AcquireFileResolutionOptions.OverwriteOptions.ForceOverwriteAll
                .CheckoutComment = "Checked out by the Vault Batch Rename application."
                .AddFileToAcquire(RenameableObject.FileIteration, AcquisitionOption.Checkout Or AcquisitionOption.Download)
            End With
RETRY:
            'Download and checkout the files.
            AcqResults = VConn.FileManager.AcquireFiles(Settings)


            For Each FileResult As FileAcquisitionResult In AcqResults.FileResults
                If Not FileResult.Status = FileAcquisitionResult.AcquisitionStatus.Success Then
                    RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | A child file could not be downloaded " & FileResult.File.EntityName & ", retrying.")
                    ELog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | A child file could not be downloaded " & FileResult.File.EntityName & ". Error: " & FileResult.Exception.ToString)
                    GoTo RETRY
                End If
            Next




            RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Successfully downloaded and checked out " & RenameableObject.OriginalName & ".")
            Return True
        Catch ex As Exception
            If ex.Message = "1103" Then
                'This error means that another associated file is still checked out, so wait and try again.
                Threading.Thread.Sleep(1000)
                GoTo RETRY
            End If
            SetResultType(eResultType.Download)
            ELog.AppendLine(Date.Now & " |  Could not acquire " & RenameableObject.OriginalName & " from vault. Vault: " & VConn.Vault & " on Server: " & UCase(VConn.Server) & "returned error: " & ex.Message)
            RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Could not acquire " & RenameableObject.OriginalName & " from vault. Error Message: " & ex.Message)
            Return False
        End Try
    End Function

Here is how I'm gathering my associations...

    Private Function GetFileAssociations(FileIt As FileIteration) As FileAssocParam()

        Dim Settings As New FileRelationshipGatheringSettings
        With Settings
            .IncludeChildren = True
            .IncludeAttachments = True
            .VersionGatheringOption = VersionGatheringOption.Latest
        End With

        Try
            Dim FileAssocs As IEnumerable(Of FileAssocLite) = VConn.FileManager.GetFileAssociationLites(New Long() {FileIt.EntityIterationId}, Settings)

            'If we didn't return anything with the previous call then return true so its not logged as an error.
            If FileAssocs.Count = 0 Then
                RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | There were no file associations for " & RenameableObject.OriginalName & ".")
                Return New List(Of FileAssocParam)().ToArray
            End If

            'Create the new list.
            'SetFileAssocParams(New List(Of FileAssocParam))
            Dim FAPArray As New List(Of FileAssocParam)

            'Convert the file association to File association parameter.
            For Each Item In FileAssocs
                'If item is the current rename file then do not add.
                If Item.CldFileId = RenameableObject.VaultFile.Id Then Continue For
                'Create and load the FileAssocParam.
                Dim FAP As New FileAssocParam
                With FAP
                    .CldFileId = Item.CldFileId
                    .ExpectedVaultPath = Item.ExpectedVaultPath
                    .RefId = Item.RefId
                    .Source = Item.Source
                    .Typ = Item.Typ
                End With
                FAPArray.Add(FAP)
            Next
            RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Successfully retrieved " & FileAssocs.Count & " file associations for " & RenameableObject.OriginalName & ".")
            Return FAPArray.ToArray
        Catch ex As Exception
            SetResultType(eResultType.Associations)
            ELog.AppendLine(Date.Now & " |  File associations could not be retrieved for " & RenameableObject.OriginalName & ". Vault: " & VConn.Vault & " on Server: " & UCase(VConn.Server) & "returned error: " & ex.Message)
            RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | File associations could not be retrieved for " & RenameableObject.OriginalName & ". Error Message: " & ex.Message)
            'Just return a null array.
            Return New List(Of FileAssocParam)().ToArray
        End Try
    End Function

And here is my check-in method...

    Private Function RenameAndCheckIn()
        For Each AcqFile As FileAcquisitionResult In AcqResults.FileResults
            'If the file has been previously checked out by the current user then we can proceed.
            If AcqFile.File.IsCheckedOutToCurrentUser Then GoTo CHECK_IN

            'If the file was just checked out during our file acquisition then it will create a NewFileIteration object.
            'If a NewFileIteration object was not created then we nee to skip the checkin.
            If AcqFile.NewFileIteration Is Nothing Then Continue For

CHECK_IN:
            'Set the comment for check-in.
            Dim RenameComment As String = "File renamed by Vault Batch Rename from " & RenameableObject.OriginalName & " to " & RenameableObject.NewName & "."

            Try
                ROT.StatusBarText = "Refreshing file associations for " & IO.Path.GetDirectoryName(RenameableObject.VaultPath) & RenameableObject.NewName
                ROT.UpdateStatusBarReadout()

                Dim AssocArray As FileAssocParam()

                'Get the file associations and Check in the file with th new name.
                If AcqFile.NewFileIteration Is Nothing Then
                    Dim NewFileIt As FileIteration = New FileIteration(VConn, AcqFile.File)
                    AssocArray = GetFileAssociations(NewFileIt)
                    Dim RF As FileIteration = VConn.FileManager.CheckinFile(NewFileIt, RenameComment, False, AssocArray, Nothing, True, RenameableObject.NewName, NewFileIt.FileClassification, False, New FilePathAbsolute(NewFileIt.CheckedOutSpec))
                Else
                    AssocArray = GetFileAssociations(AcqFile.NewFileIteration)
                    Dim RF As FileIteration = VConn.FileManager.CheckinFile(AcqFile.NewFileIteration, RenameComment, False, AssocArray, Nothing, True, RenameableObject.NewName, AcqFile.NewFileIteration.FileClassification, False, New FilePathAbsolute(AcqFile.NewFileIteration.CheckedOutSpec))
                End If

                RNILog.AppendLine(Date.Now & ", Successfully renamed " & RenameableObject.OriginalName & " to " & RenameableObject.NewName & ". , " & VConn.Vault & "' " & UCase(VConn.Server))
                RNILogCount += 1
                RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Successfully renamed " & RenameableObject.OriginalName & " to " & RenameableObject.NewName & ".")
                Return True
            Catch ex As Exception
                SetResultType(eResultType.Checkin)
                ELog.AppendLine(Date.Now & " |  Could not rename " & RenameableObject.OriginalName & " to " & RenameableObject.NewName & ". Vault: " & VConn.Vault & " on Server: " & UCase(VConn.Server) & "returned error: " & ex.Message)
                RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Could not rename " & RenameableObject.OriginalName & ". Error Message: " & ex.Message)
                Return False
            End Try
        Next
        Return True
    End Function

Any help would be appreciated!


Automation is key!
0 Likes
Accepted solutions (1)
4,159 Views
4 Replies
Replies (4)
Message 2 of 5

Boorda
Advocate
Advocate
Accepted solution

OK, so ultimately here's what I figured out.

 

I originally had a RenameWorker Class that would handle acquiring a file and its associations, then check it in with a new name based on a CVS file that supplies the path in Vault and the expected new name. The problem arose when trying to check in a drawing or assembly file that had any of the associations checked out to the current user. So I had to build a check-in method that was recursive and checks-in any checked out association first, then the parent. As you can imagine, with multi-threading this becomes a nightmare so I no longer have that RenameWorker class that handles multiple files on different threads at once. Instead I have to acquire up-to 5000 files at a time, regenerate their associations, and rename during the check-in, one file at a time. I chose 5000, but I think @Redmond.D mentions it would be ok to acquire up-to 10,000 at a time in a blog somewhere. Multi-threaded check-ins could probably be done with a lot of work, but it would required an elaborate scheme for tracking whats being checked in on each thread and when to delegate an association check-in.

 

With all of the struggles, and the lack of documentation on working with mass check-ins, I though I would share my code and what I've learned.

So here goes....

 

 

For the sake of readability and to not have a tremendous amount of code I do not fully qualify every object, I use Imports statements.

You will need these:

 

Imports Autodesk.Connectivity.WebServices
Imports Autodesk.DataManagement.Client.Framework.Currency
Imports Autodesk.DataManagement.Client.Framework.Vault.Currency
Imports Autodesk.DataManagement.Client.Framework.Vault.Currency.Entities
Imports Autodesk.DataManagement.Client.Framework.Vault.Results
Imports Autodesk.DataManagement.Client.Framework.Vault.Settings
Imports Autodesk.DataManagement.Client.Framework.Vault.Settings.AcquireFilesSettings

 

1. Create a List(Of FileIteration) that you can use to add to the .AddFileToAcquire method in the AcquireFileSettings.

    Setup your AcquireFilesSettings and acquire the files.

 

     Some things to note about the sample code below:
            A. My custom sRenamableObject class has the FileIterations that I want to acquire.

            B. The AEO object allows me to hook into Vault's events related to acquiring files, you can exclude

                that line and the variable if you don't need to capture events.

            C. The "OR" in AcquisitionOption.Checkout Or AcquisitionOption.Download is a bit operator, meaning

                that it will do both, not just one or the other. It could be replaced with the number 3 and it would

                do the same thing.

 

   Acquire Method

     'These are global to the current class.   
Public AcqResults As AcquireFilesResults
Public RenameableObjList As List(Of sRenameableObject)
Public WithEvents AEO As AcquireFileExtensibilityOptions

Public Function AcquireFiles(RenameableObjList As List(Of sRenameableObject)) As Boolean Try 'Setup the acquire options. Dim Settings As New AcquireFilesSettings(VConn) With Settings AEO = Settings.OptionsExtensibility .OptionsRelationshipGathering.FileRelationshipSettings.VersionGatheringOption = VersionGatheringOption.Latest .OptionsRelationshipGathering.FileRelationshipSettings.IncludeChildren = True .OptionsRelationshipGathering.FileRelationshipSettings.RecurseChildren = True .OptionsRelationshipGathering.FileRelationshipSettings.IncludeLibraryContents = True .OptionsResolution.OverwriteOption = AcquireFileResolutionOptions.OverwriteOptions.ForceOverwriteAll .DefaultAcquisitionOption = AcquisitionOption.Download .OptionsResolution.SyncWithRemoteSiteSetting = SyncWithRemoteSite.Always .CheckoutComment = "Checked out by the Vault Batch Rename application." For Each RNO As sRenameableObject In RenameableObjList .AddFileToAcquire(RNO.FileIteration, AcquisitionOption.Checkout Or AcquisitionOption.Download) Next End With 'Download and checkout the files. AcqResults = VConn.FileManager.AcquireFiles(Settings) Return True Catch ex As Exception WriteToLog(Date.Now & " | There was an error acquiring files from vault. Vault: " & VConn.Vault & " on Server: " & UCase(VConn.Server) & "returned error: " & ex.Message & vbNewLine, eLogType.ErrorLog) WriteToLog(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | There was an error acquiring files from vault. Error Message: " & ex.Message & vbNewLine, eLogType.RunLog) Return False End Try End Function

 

 2. Build the list of files that you will be checking in using the FileResults from you AcquireFilesResults object;

      in this case named AcqResults.

 

     I run this on a background worker as to not freeze up the user interface for my app,

     but you can do this in a regular sub.

 

     Here is what this method does:

          A. It converts the FileResults to a list that I can better manipulate, I call mine CheckinList

          B. Removes any files from the list that I do not have checked out.

          C. Sorts the list by .ipt, .iam, .ipn, .idw, .dwg, .* (Any other file type). I do this to help limit

              the recursive calls I need to make. The idea is that if all part files are checked in before I

              get to an assembly file then I won't need to jump down to check it in then back up to

              check in the assembly. Same goes for assemblies before drawings.

          D. I'm converting my CheckinList to a dictionary using the filename as the key, but you could

              skip doing that and just use the CheckinList when calling the CheckinFile method.

          E. Starts the loop calling the CheckinFile method passing in one FileAcquisitionResult at a time.

 

   BackgroundWorker DoWork Method 

    Dim CheckinDictionary As New Dictionary(Of String, FileAcquisitionResult)
Private Sub RenameWorker_DoWork(sender As Object, e As DoWorkEventArgs) Handles RenameWorker.DoWork 'Convert the File results to a list so we can modify it. Dim CheckinList As List(Of FileAcquisitionResult) = AcqResults.FileResults.ToList WriteToLog(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Removing non checked-out files from the acquisition list.... " & vbNewLine, eLogType.RunLog) Debug.WriteLine("Removing non checked-out files from the acquisition list....") 'Remove any files that aren't checked out for the rename process. RESTART_CHECKLIST_MOD: For Each AcqFile As FileAcquisitionResult In CheckinList 'If the file has been previously checked out by the current user then keep. If AcqFile.File.IsCheckedOutToCurrentUser Then Continue For 'If the file was just checked out during our file acquisition then it will create a NewFileIteration object. If Not AcqFile.NewFileIteration Is Nothing Then Continue For 'If a NewFileIteration object was not created then the file is not checked out and we need to remove it form the check-in list. CheckinList.Remove(AcqFile) 'We need to skip out and start over since the collection was modified, otherwise we'll generate an exception. 'Don't worry though, the file is no longer in the collection, it'll be quicker this time I promise. GoTo RESTART_CHECKLIST_MOD Next 'Now Sort the list by .ipt, .iam, .ipn, .idw, .dwg, .* CheckinList.Sort(Function(A As FileAcquisitionResult, B As FileAcquisitionResult) Dim ExtA As String = IO.Path.GetExtension(A.File.EntityName) Dim ExtB As String = IO.Path.GetExtension(B.File.EntityName) Dim iExtA As Integer = GetFileExtensionOrder(ExtA) Dim iExtB As Integer = GetFileExtensionOrder(ExtB) Return iExtA.CompareTo(iExtB) End Function) 'Convert to dictionary to make life easier by assigning keys. CheckinDictionary = CheckinList.ToDictionary(Function(x As FileAcquisitionResult) Return x.File.EntityName End Function) WriteToLog(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Commencing check-in operation.... " & vbNewLine, eLogType.RunLog) Debug.WriteLine("Commencing check-in operation....") RESTART_CHECKIN_LOOP: 'Start the check-in process. For Each AcqFile As FileAcquisitionResult In CheckinDictionary.Values Call CheckinFile(AcqFile) 'We need to skip out and start over since the collection was modified. 'Checked in files are no longer in the collection. GoTo RESTART_CHECKIN_LOOP Next
'Phew, that was tough wasn't it! All Done. End Sub

 

This method is used to help sort the files in the .ipt, .iam, .ipn, .idw, .dwg, .* (Any other file type) order.

It is called in the lambda expression used in the  CheckinList.Sort() call in the method above (See red text).

 

GetFileExtensionOrder Method 

   Private Function GetFileExtensionOrder(FileExtension As String) As Integer
        Select Case LCase(FileExtension)
            Case ".ipt"
                Return 0
            Case ".iam"
                Return 1
            Case ".ipn"
                Return 2
            Case ".idw"
                Return 3
            Case ".dwg"
                Return 3
            Case Else
                Return 4
        End Select
    End Function

 

 

3. Call the CheckinFile Method

 

    This method does the following:

         A. Makes sure that a FileIteration object exists. A FileIteration typically needs to be created when

              a file was previously checked out but not checked out during our file acquisition.

         B. Gets the file associations using the FileIteration object. (See last code sample for that method.)

         C. Checks that any association are not checked out by the current user. If there are any

              then this is where we call this method again recursively.

         D. Checks in the file.  

 

CheckinFile Method 

   Private Sub CheckinFile(AcqFile As FileAcquisitionResult)

        Try
            WriteToLog(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Refreshing file associations for " & AcqFile.File.EntityName & vbNewLine, eLogType.RunLog)
            Debug.WriteLine("Refreshing file associations for " & AcqFile.File.EntityName)

            Dim AssocArray As FileAssocParam()
            Dim FileIt As FileIteration = AcqFile.NewFileIteration
            
            If FileIt Is Nothing Then
                FileIt = New FileIteration(VConn, AcqFile.File)
            End If

'Get the file associations. AssocArray = GetFileAssociations(FileIt) 'Check to make sure any underlying checked out associations are checked in first. For Each FileRef As FileAssocParam In AssocArray 'Get the File Name of the referenced file. Dim RefFileName As String = IO.Path.GetFileName(FileRef.ExpectedVaultPath) If CheckinDictionary.Keys.Contains(RefFileName) Then 'A referenced file is in our dictionary so it needs to be checked in first. Call CheckinFile(CheckinDictionary(RefFileName)) End If Next 'Check the file in with the new name, obviously need to add a way to get the new name, Debug.WriteLine("Checking in file: " & AcqFile.File.EntityName)
'Get the new name for the acquired file or skip. Dim NN = ListOfRenameables(AcqFile.File.EntityName)
'Set the comment for check-in. Dim RenameComment As String = "File renamed by Vault Batch Rename from " & AcqFile.File.EntityName & " to " & NN & "."
'Do the check-in Dim RF As FileIteration = VConn.FileManager.CheckinFile(FileIt, RenameComment, False, AssocArray, Nothing, True, NN, FileIt.FileClassification, False, New FilePathAbsolute(FileIt.CheckedOutSpec))
'Remove the item out of the file list. CheckinDictionary.Remove(AcqFile.File.EntityName) WriteToLog(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Successfully renamed " & AcqFile.File.EntityName & " to " & NN & "." & vbNewLine, eLogType.RunLog) Debug.WriteLine("Successfully renamed: " & AcqFile.File.EntityName & " to " & RF.EntityName) Catch ex As Exception Debug.WriteLine("File Check-in Failed: " & AcqFile.File.EntityName & " ERROR: " & ex.ToString) 'There was an error, put it in the log to track down later, but we must
'remove it from the collection so we dont get caught in a loop.
CheckinDictionary.Remove(AcqFile.File.EntityName) WriteToLog(Date.Now & " | Could not rename " & AcqFile.File.EntityName & ". Vault: " & VConn.Vault & " on Server: " & UCase(VConn.Server) & "returned error: " & ex.Message & vbNewLine, eLogType.ErrorLog) WriteToLog(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Could not rename " & AcqFile.File.EntityName & ". Error Message: " & ex.Message & vbNewLine, eLogType.RunLog) 'Return False End Try End Sub

 

And finally here is how I'm getting my file associations. If you don't do this then when you check in a file it will not have any parents or children!

You have to rebuild the associations! You don't want you assemblies to be missing all of their components and have to resolve every one of them the next time you open it.

 

GetFileAssociations Method 

    Private Function GetFileAssociations(FileIt As FileIteration) As FileAssocParam()

        Dim Settings As New FileRelationshipGatheringSettings
        With Settings
            .IncludeChildren = True
            .IncludeAttachments = True
            .VersionGatheringOption = VersionGatheringOption.Latest
        End With

        Try
            Dim FileAssocs As IEnumerable(Of FileAssocLite) = VConn.FileManager.GetFileAssociationLites(New Long() {FileIt.EntityIterationId}, Settings)

            'If we didn't return anything with the previous call then return true so its not logged as an error.
            If FileAssocs.Count = 0 Then
                ' RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | There were no file associations for " & RenameableObject.OriginalName & ".")
                Return New List(Of FileAssocParam)().ToArray
            End If

            'Create the new list.
            Dim FAPArray As New List(Of FileAssocParam)

            'Convert the file association to File association parameter.
            For Each Item In FileAssocs
                'If item is the current rename file then do not add.
                If Item.CldFileId = Item.ParFileId Then Continue For
                'Create and load the FileAssocParam.
                Dim FAP As New FileAssocParam
                With FAP
                    .CldFileId = Item.CldFileId
                    .ExpectedVaultPath = Item.ExpectedVaultPath
                    .RefId = Item.RefId
                    .Source = Item.Source
                    .Typ = Item.Typ
                End With
                FAPArray.Add(FAP)
            Next
            '  RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | Successfully retrieved " & FileAssocs.Count & " file associations for " & RenameableObject.OriginalName & ".")
            Return FAPArray.ToArray
        Catch ex As Exception
            'SetResultType(eResultType.Associations)
            'ELog.AppendLine(Date.Now & " |  File associations could not be retrieved for " & RenameableObject.OriginalName & ". Vault: " & VConn.Vault & " on Server: " & UCase(VConn.Server) & "returned error: " & ex.Message)
            'RLog.AppendLine(Date.Now & " | " & UCase(VConn.Server) & " | " & VConn.Vault & " | File associations could not be retrieved for " & RenameableObject.OriginalName & ". Error Message: " & ex.Message)
            ''Just return a null array.
            Return New List(Of FileAssocParam)().ToArray
        End Try
    End Function

 

Well that took way longer to write out than I expected. I hope this helps any of you who are working with the Valut API and working with single or mass check-ins.

 

 

-Addam

 

 


Automation is key!
Message 3 of 5

Boorda
Advocate
Advocate

 

I would still love to hear someone's point of view from Autodesk.

Is there a better way, whats the best practice, yadda, yadda.....

 


Automation is key!
0 Likes
Message 4 of 5

CadUser46
Collaborator
Collaborator

I doubt you'll get an answer.  They're pretty touchy about this checkin function. I wish they would just expose a vdf function that is the same as the addin. 

 

I managed something similar to you to you but did it via Inventor and the Vault addin. Setup some options to suppress some dialogs the call the checkin function. I used a tool called PushButton to catch the error dialogs and just mash the continue button.

 

1. As per other post, used Vault api to aquirefiles. 

2. Migrate and resolve in Inventor driven by Excel list.

3. Checkin with Inventor driven by Excel list. 

 

For all all of these I just ran multiple sessions. It's not as elegant as yours but I'm an engineer, not a developer. 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 5 of 5

Boorda
Advocate
Advocate

Thanks for the feedback, most of the time when I have questions it seems like its always about stuff that no on wants to talk about.

I finally got something to work, the only difference in the code above was I went with AcquireFilesAsync instead of AcquireFiles.

Sped things up a bit.

 

Originally I just wanted to rename the files in Vault without having to do any downloading at all, but then I wouldn't get the built-in file resolution functionality.

It kind-of begs the question as to why Vault can't handle relationships; why does it take the Vault Inventor add-in or downloading files to fix file relationships?

I mean even when you try to upload an assembly to Vault via Add Files command it tells you that relationships will be lost. I would expect that Vault should handle these things on its own.  I also wish the the file associations weren't such a pain, if they aren't changing then let us pass a null and Vault reuse the associations from the previous version, similar to what you can do with a BOM that doesn't change. Just my thoughts.


Automation is key!
0 Likes