Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't get the idw for Item - ItemFileLnkTypOpt.Tertiary

1 REPLY 1
Reply
Message 1 of 2
alexander.hovden
333 Views, 1 Reply

Can't get the idw for Item - ItemFileLnkTypOpt.Tertiary

                Dim associations As ItemFileAssoc() = itemSvc.GetItemFileAssociationsByItemIds(ItemIds, ItemFileLnkTypOpt.Tertiary) 'primary
Dim associationsSec As ItemFileAssoc() = itemSvc.GetItemFileAssociationsByItemIds(ItemIds, ItemFileLnkTypOpt.Primary Or ItemFileLnkTypOpt.PrimarySub Or ItemFileLnkTypOpt.Secondary Or ItemFileLnkTypOpt.SecondarySub Or ItemFileLnkTypOpt.StandardComponent Or ItemFileLnkTypOpt.Tertiary) 'everything If Not associations.Length = 0 OrElse Not associationsSec.Length = 0 Then ' Only creates rows for items with seperate drawings Dim ItemNumber As String = ChildItem(0).ItemNum Dim SeperateDrawing As Boolean = False For a As Integer = 0 To UBound(associations) If Mid(ItemNumber, 1, 6) = Mid(associations(a).FileName, 1, 6) Then SeperateDrawing = True Exit For End If Next Dim SeperateDrawingSec As Boolean = False For a As Integer = 0 To UBound(associationsSec) If Mid(ItemNumber, 1, 6) & ".idw" = associationsSec(a).FileName Then SeperateDrawingSec = True Exit For End If Next If SeperateDrawing OrElse SeperateDrawingSec Then

Check the attached picture and you can see the Item 206640 has an idw-file.
But I can't get the file with this code. I can for many items, but some.. no 😞

 

With associationsSec I try every ItemFileLnkTypOpt there is, but still no files. I've logged some info:

 

4/24/2014 12:26:49 PM ChildItemNum 206233
4/24/2014 12:26:49 PM Cloaked = False
4/24/2014 12:26:49 PM associations = 1
4/24/2014 12:26:49 PM associationsSec = 2
4/24/2014 12:26:49 PM associations(a).FileName = 206233.idw
4/24/2014 12:26:49 PM associations(a).Cloaked = False
4/24/2014 12:26:49 PM associationsSec(a).FileName = 206233.ipt
4/24/2014 12:26:49 PM associationsSec(a).Cloaked = False
4/24/2014 12:26:49 PM associationsSec(a).FileName = 206233.idw
4/24/2014 12:26:49 PM associationsSec(a).Cloaked = False


4/24/2014 12:26:49 PM ChildItemNum 206640
4/24/2014 12:26:49 PM Cloaked = False
4/24/2014 12:26:49 PM associations = 0
4/24/2014 12:26:49 PM associationsSec = 1
4/24/2014 12:26:49 PM associationsSec(a).FileName = 206640.ipt
4/24/2014 12:26:49 PM associationsSec(a).Cloaked = False

 

 

Any ideas? 🙂

1 REPLY 1
Message 2 of 2

I solved this..

 

I got the wrong childitem id, i selected childitem(0), when I should've selected childitem(childitem.length -1).

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report