
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to make changes to iProperties of an ipt file and check it back into the vault through the Inventor/Vault API, and seem to be running into some issues.
Here is my process:
1. Download the file from the Vault through the API (using FileManager.AcquireFiles)
2. Open the file in Inventor
3. Update the iProperties
4. Save the file
5. Check in the file to the Vault (using FileManager.CheckinFile, with file associations through FileManager.GetFileAssociationLites)
I have succeeded when doing this for idw files, but for ipt file I get an error 1022, which I gather means that I have a file association to the file I'm checking in). I used to have this issue with the idw file, but added a check where I would remove associations if the CldFileId of the associated file matched the EntityIterationId of the file I'm trying to check in. This check doesn't seem to work when checking in an ipt file because the IDs don't match, even though the file name is the same.
Is there a way for me to get the correct associations of the files for all file types?
Here is the code for how I obtain the file associations:
Private Function Vault_GetFileAssocs(connection As VDF.Vault.Currency.Connections.Connection, oFileIteration As VDF.Vault.Currency.Entities.FileIteration) As FileAssocParam() Dim myFileRelationshipSettings As VDF.Vault.Settings.FileRelationshipGatheringSettings myFileRelationshipSettings = New VDF.Vault.Settings.FileRelationshipGatheringSettings myFileRelationshipSettings.IncludeAttachments = True myFileRelationshipSettings.IncludeChildren = True myFileRelationshipSettings.IncludeParents = True myFileRelationshipSettings.IncludeRelatedDocumentation = True Dim myColOfFileAssocLite As System.Collections.Generic.IEnumerable(Of ACW.FileAssocLite) = Nothing myColOfFileAssocLite = connection.FileManager.GetFileAssociationLites(New Long() {oFileIteration.EntityIterationId}, myFileRelationshipSettings) Dim fileAssocParams As ArrayList = New ArrayList ' Add FileAssocParam objects to the ArrayList ' using values from the collection ' of FileAssocLite in the collection ' returned from GetFileAssociationLites() If Not myColOfFileAssocLite Is Nothing Then Dim myFileAssocLite As FileAssocLite ' 'Go through each FileAssoLite in the ' in the collection of FileAssocLite For Each myFileAssocLite In myColOfFileAssocLite ' This is a new FileAssocParam that ' is going to be added to the List ' getting the properties If myFileAssocLite.CldFileId <> oFileIteration.EntityIterationId Then Dim par As FileAssocParam = New FileAssocParam() par.CldFileId = myFileAssocLite.CldFileId par.RefId = myFileAssocLite.RefId par.Source = myFileAssocLite.Source par.Typ = myFileAssocLite.Typ par.ExpectedVaultPath = myFileAssocLite.ExpectedVaultPath fileAssocParams.Add(par) End If Next End If Dim myFileAssocParamArray As FileAssocParam() = DirectCast(fileAssocParams.ToArray(GetType(FileAssocParam)), FileAssocParam()) Return myFileAssocParamArray End Function
Solved! Go to Solution.