Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BOM different order on export

3 REPLIES 3
Reply
Message 1 of 4
skyngu
452 Views, 3 Replies

BOM different order on export

hi, I found a issue that vba reads bom in different way when I tried to export bom to excel. here is the routie i am using for BOM. I am using inventor 2012 sp1, window 7 sp1 and excel 2007

1. create a assembly with bom structured view enabled.

2. open BOM editor in structured view tab. sort BOM by part number, and renumber them from 1,2,3....

3. save and exit.

4. in vba, i used code below

For Each oRow In oStructuredBOMView.BOMRows

Set oDoc = oRow.ComponentDefinition(1).Document

 .........................................................................................................................

 

 on the export bom excel sheet, the item order is different from BOM in assembly file. on the excel sheet, the order of item number is same before sorting and renumber BOM. It seems to me that BOM editor didnt remember sorting and renumber. is this a bug? or any fix? thanks for any suggestions.

Autodesk Inventor Professional 2019
3 REPLIES 3
Message 2 of 4
skyngu
in reply to: skyngu

 anyone have an idea on this issue? thanks

Autodesk Inventor Professional 2019
Message 3 of 4
Kris_Inv2013
in reply to: skyngu

I am encountering with the same problem, have no idea how to come over this within Inventor. Might have to be customised via VBA in excel??

There seems to be a break down in tech support.

Message 4 of 4

You may develop one function (GetMyBOMRow) that returns BOMRow object with specified ItemNumber and another subroutine (ExportBOMRowToExcel) that exports specified BOMRow data into the Excel sheet.

Then you may export data row by row in the desired order using For – Next loop:

For i = 1 to NMax
   oBOMRow = GetMyBOMRow(i)
   call ExportBOMRowToExcel(oBOMRow)
Next i

Here NMax is  the maximal item number value in BOMRows collection.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report