Community
Vault Forum
Welcome to Autodesk’s Vault Forums. Share your knowledge, ask questions, and explore popular Vault topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Package Sevice

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
208 Views, 2 Replies

Package Sevice

I am in need of an example on how the package service works. I am trying to use the DownloadPackage method, but I am stuck in what to put into the parameters.
I use this code after selecting an Item from a list
SelectedItem = itmSvc.GetItemsByIds(SelectedItemID)
Dim Bom As ItmSvc.ItemBOM
Dim ItemRevArray() As ItmSvc.Item
Dim ItemAssocArray() As ItmSvc.ItemAssoc
Dim OccurArray()
Bom = itmSvc.GetItemBOMByDate(SelectedItem(0).MasterId, Now(), PS_Test1.ItmSvc.BOMTyp.Tip, PS_Test1.ItmSvc.BOMViewEditOptions.Defaults)
ItemRevArray = Bom.ItemRevArray
ItemAssocArray = Bom.ItemAssocArray
OccurArray = Bom.OccurArray

What should I do with this info?
What else do I need in order to produce a DWF package or a csv-file?

Ronny
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

I'm not sure if this is what you want:

sub Test()
If m_selectedItem Is Nothing Then Exit Sub
Dim Items(0) As Long
Items(0) = Me.m_selectedItem.Id

Dim m_packageSvc As PackageServiceWse = ServiceManager.GetPackageService()
Dim IAB As PackageSvc.PkgItemsAndBOM
IAB = m_packageSvc.GetItemsAndBOMsFromItemIds(Items)

GoThroughItems(IAB.PkgBOM, IAB)
end sub

Private Sub GoThroughItems(ByVal oBomItem As PkgBOM, ByVal IAB As PkgItemsAndBOM)
For Each BomItem As PkgBOM In oBomItem.BOMArray
Debug.Print(IAB.PkgItemArray(BomItem.ItemIdx).ItemTitle())
If BomItem.BOMArray.Length > 1 Then GoThroughItems(BomItem, IAB)
Next
End Sub
Message 3 of 3
Anonymous
in reply to: Anonymous

Thank you for replying to this thread, but I have already solved it by myself.
Luckily I found a code sample on ADN that described the whole package export process, it was written for ADMS 5 and in C#, but I managed to translate it. Forgot to update the thread.

Thanks again
Ronny

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

Post to forums  

Autodesk Design & Make Report