Inventor Customization

Inventor Customization

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

BOM different order on export

269 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: 340
Registered: ‎04-10-2010
Message 2 of 4 (249 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 (147 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: 531
Registered: ‎08-14-2012
Message 4 of 4 (128 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.