AnsweredAssumed Answered

SolidWorks API question - Items and BOMs

Question asked by Ken Hayes on May 2, 2016
Latest reply on May 2, 2016 by Artem Taturevych

Hi, new to the forum.  We are an ERP developer, and are being asked about integration from Inventor to our Item Master / Bill of Material Master tables. 

We have an import facility that can take a text file (with two header lines formatted just so), containing rows of items and / or BOM records and import them into our system.

 

I worked on this a little last yeare, and found more examples of deriving this data from the table shown on the drawing file itself, which the user may or not populate with everything I need for a given export, so that is one questrion I have - what is the proper source of Item and BOM data when I have a given drawing / part file open.

 

I am looking for the correct resource / forum to understand how the API works and whether the SolidWorks API can output a single file that combines both Item and BOM data like this (I apologize if I am putting in too much data in the wrong forum):  

 

For the Item Master: 

IM-TYPE of 1 = Fabricated (the parent), IM-TYPE of 2 = Purchased (the child) 

 

DECL(IM) IM-KEY IM-DESCR IM-TYPE IM-REV

END

"ITEM-PARENT" "PARENT ITEM" 1 "A"

"ITEM-CHILD-1" "FIRST CHILD ITEM" 2 "B"

"ITEM-CHILD-2" "SECOND CHILD ITEM" 2 "D"   

 

For the Bill of Material (PS - Product Structure) data for this relationship, one parent with two components:  

 

DECL(PS) PS-PARENT-KEY PS-SUBORD-KEY PS-PIECE-NO PS-REV - PS-QTY-P

END

"ITEM-PARENT" "ITEM-CHILD-1" "001" "A" 2

"ITEM-PARENT" "ITEM-CHILD-2" "002" "A" 1 

 

Making a single file that looks like this:

 

DECL(IM) IM-KEY IM-DESCR IM-TYPE IM-REV

END

"ITEM-PARENT" "PARENT ITEM" 1 "A"

"ITEM-CHILD-1" "FIRST CHILD ITEM" 2 "B"

"ITEM-CHILD-2" "SECOND CHILD ITEM" 2 "D"

DECL(PS) PS-PARENT-KEY PS-SUBORD-KEY PS-PIECE-NO PS-REV - PS-QTY-P

END

"ITEM-PARENT" "ITEM-CHILD-1" "001" "A" 2

"ITEM-PARENT" "ITEM-CHILD-2" "002" "A" 1

 

Each 'DECL' / END set of lines begins a new table callout, and can be combined in the same text file. 

 

Thanks for your help, all! 

Ken Hayes

Outcomes