acquire files from vault, but doesn't download when (older) file already exists

acquire files from vault, but doesn't download when (older) file already exists

k.vuyst
Participant Participant
259 Views
1 Reply
Message 1 of 2

acquire files from vault, but doesn't download when (older) file already exists

k.vuyst
Participant
Participant

Hi all, i'm having trouble with my VB code. 
I'm trying to get all the latest design data from my vault, but it only downloads the files locally when it can't find it. If there is an out of date file, it doesn't download it (It somehow reads that the current checked in file is the same as local).

My guess is that i don't call the file with the right methode, but perhapse somebody recognizes the issue.

 


If folders IsNot Nothing AndAlso folders.Any() Then
For Each folder As VDF.Vault.Currency.Entities.Folder In folders
If folder.FullName.Contains("$/Settings") Then
Dim childFiles As Autodesk.Connectivity.WebServices.File() = vConnection.WebServiceManager.DocumentService.GetLatestFilesByFolderId(folder.Id, False)
If childFiles IsNot Nothing Then
For Each file As Autodesk.Connectivity.WebServices.File In childFiles
Dim FileItter = New VDF.Vault.Currency.Entities.FileIteration(vConnection, file)
settings.AddFileToAcquire(FileItter, VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Download)
Next
End If
End If
Next
End If

0 Likes
260 Views
1 Reply
Reply (1)
Message 2 of 2

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Use it this way:

Private Sub downloadFile(connection As VDF.Vault.Currency.Connections.Connection, file As VDF.Vault.Currency.Entities.FileIteration, folderPath As String)

        Dim settings As New VDF.Vault.Settings.AcquireFilesSettings(connection, False)

        settings.AddFileToAcquire(file, VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Download)

        settings.LocalPath = New VDF.Currency.FolderPathAbsolute(folderPath)
        'settings.OptionsRelationshipGathering.FileRelationshipSettings.IncludeChildren = True
        'settings.OptionsRelationshipGathering.FileRelationshipSettings.RecurseChildren = True
        'settings.OptionsRelationshipGathering.FileRelationshipSettings.VersionGatheringOption = VDF.Vault.Currency.VersionGatheringOption.Latest
        connection.FileManager.AcquireFiles(settings)

    End Sub

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes