Inventor Customization

Reply
Valued Mentor
jcneal
Posts: 337
Registered: ‎04-10-2010
Message 1 of 4 (258 Views)

BOM different order on export

258 Views, 3 Replies
10-22-2011 07:59 PM

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 2014
Autodesk Product Design Suite Standard 2014
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2014
Visual Studio Express 2010
Valued Mentor
jcneal
Posts: 337
Registered: ‎04-10-2010
Message 2 of 4 (238 Views)

Re: BOM different order on export

10-27-2011 03:34 PM in reply to: jcneal

 anyone have an idea on this issue? thanks

Autodesk Inventor Professional 2014
Autodesk Product Design Suite Standard 2014
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2014
Visual Studio Express 2010
Active Contributor
Kris_Inv2013
Posts: 39
Registered: ‎07-19-2012
Message 3 of 4 (136 Views)

Re: BOM different order on export

11-20-2012 12:42 AM in reply to: jcneal

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.

ADN Support Specialist
Vladimir.Ananyev
Posts: 479
Registered: ‎08-14-2012
Message 4 of 4 (117 Views)

Re: BOM different order on export

11-27-2012 05:49 AM in reply to: Kris_Inv2013

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

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.