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: 

API Export - relate PkgBOM and pkgItem

5 REPLIES 5
Reply
Message 1 of 6
Craig_Schuler
697 Views, 5 Replies

API Export - relate PkgBOM and pkgItem

Working with the API to export BOM data for ERP system. Using the Package service with GetItemBomsFromItemIds returns multiple arrays - pkgBOM and pkgItem. The Item array contains all items including sub assembly items that I am not concerned about for exporting - question is how do I relate the two arrays to each other so that I can say this item has a quantity. When I look at the BOM package array I do not see an ItemID?

What am I missing?
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Craig_Schuler


The PkgBOM.ItemIdx value is an index into the
pkgItem array.  So that's how you correlate the two pieces of
data. 

 

However, you might not want to use the Package
service for this case...

When exporting or importing there are two ways to
do it.  You can use the Item service or the Package service.  The
Package service is useful if you want to end up with an XML, DWF or CSV
file.  If you are not dealing with those file types, the Item service might
be easier to use. 

 

For example you can call ItemService.GetBOMByDate,
which lets you specify different options for how the BOM should be
returned.

 

 

Doug Redmond

Software Engineer, Autodesk
Inc.
Message 3 of 6

Doug - thanks for your help

I have worked with the Itemservice GetItemBOMByDate - problem that I have is that does not return the DetailID that the BOM has - maybe I missed it. I need this to pass to the ERP system because it is a position number that never changes with in the row of the BOM.

Does that make sense?


Thanks


Craig
Message 4 of 6
Anonymous
in reply to: Craig_Schuler


You can get the Detail ID through
face="Times New Roman" size=3>GetItemBOMByDate. 
Use ReturnOccurrences as one of the options (you can AND together
multiple options).  In the resulting ItemBOM object, check the
OccurArray.  It should contain the Detail ID, which is the 'Val' property
on the ItemBOMOcc object.

 

 

Doug Redmond

Software Engineer, Autodesk
Inc.
Message 5 of 6

Doug how do you relate with in the arrays of the GetItemBOMByDate - ReturnOccurrences

I get the Arrays - ItemAssocArray, ItemRevArray - how do I relate them?

I am assuming there is no way to call the values all together - do I need to use nested For loops to get data that is crossreferenced?



Thanks
Message 6 of 6
Anonymous
in reply to: Craig_Schuler


I'm not sure if you understand what your question
is....

 

The PartItemID and CldItemID values in
ItemAssocArray point to Id values in ItemRevArray.  So that's how you
correlate the two arrays.
The ReturnOccurrences
option should also cause values to show up in the OccurArray.  ParOccId
points to the parent ItemBOMOcc object and CldItemMasterId points to a MasterId
value from in the ItemRevArray.

 

Now comes the hard part, figuring out what to do
with the data.  There are many ways to go from here.  You can scan the
data for specific parts of information, you can build a tree structure with the
entire BOM, you can create your own arrays, and so on.

 

It really depends on what problem you are trying to
solve.  Since you are exporting specific parts of the BOM, using nested FOR
loops should work fine.

 

 

Doug Redmond

Software Engineer, Autodesk
Inc

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

Post to forums  

Autodesk Design & Make Report