Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Top Level Order of Structured BOM to Match Lower Levels

15 REPLIES 15
Reply
Message 1 of 16
danmorick
1728 Views, 15 Replies

Top Level Order of Structured BOM to Match Lower Levels

I have an assembly made up of subassemblies and parts.  I have reordered and renumbered the structured BOMs of the subassemblies.  But when I view the structured BOM from the top level, it does not reflect the new order of the lower levels.

 

Is there a way to pass the structured BOM order from a subassembly up to an assembly that contains it so that the order of the all-levels structured BOM matches the order of the individual BOMs below it?  I expected this would happen automatically.

 

What I am going for is to be able to export the all-levels structured BOM of the top assembly so that someone can read straight down that list, and it directly follows the order of the parts lists in the drawing package.

 

 

Thanks in advance.

15 REPLIES 15
Message 2 of 16
salariua
in reply to: danmorick

I always set the item number at the top level assembly, for exports and Parts List.

 

It has always been a pain to do these but it takes seconds to fix. Normally in the top level assembly right at the end when the project is done I renumber them like this:

 

1. Go to BOM in the assembly and enable the view, change it to all levels in the View Properties

2. Right clicking on the columns and selecting Runtime Coulumn Customization, add BOM Structure, Component Path and File Path.

3. Use Sort Items and sort by:

3.1 BOM Structure - Ascending (this way you will have normal parts at the top and purchased, phantom reference at the bottom)

3.2 Component type - Ascending (this puts the assemblies and subassemblies at the top and parts at the end)

3.3 File Path - Ascending (if you have a logical part number structure and filename then it sorts by that)

4 Click ok and go to Renumber Items, make sure it set to renumber all rows. Specify the Start (I have it on 1) and increment (1 again)

When you click ok they are all sorted out.

 

Unfortunately because each level can have suppressed, hidden components, this so you can generate a different structure, the component number is not linked between different levels. But it takes seconds to do this on subassemblies and sort them out too, and the item number should correspond because you use same sort order.

 

 

Let me know how that goes for you. You don't need to use expand all but I did it to check results.

 

620.gif

 

 

 

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 3 of 16
danmorick
in reply to: salariua

Thanks very much for the detailed response.  Your method makes sense and does work.  Good stuff.  However, what I would like to do is arrange components in a "major-at-top, minor-at-bottom" kind of way... an order that can't be achieved purely through the sort tool.  I would have to create a custom iproperty for each component indicating its place in its parent assembly's BOM; this would then fail when one part is used in multiple, different assemblies, which happens for me quite often.

 

What I was hoping to find is some synchronization tool that would pass the existing BOM order from lower levels up to higher levels (not necessarily the numbering but the order).  I'd expect this just to happen automatically, but I can't even find an option for it.  Apparently it doesn't exist and I'm not missing something.

 

Thanks again.

Message 4 of 16
salariua
in reply to: danmorick

Dan,

 

What do you mean by Major-Top, Minor-Bottom? Is that a Part Number sequence? Is that the order in which they were placed in the assembly? Give us an example to try and help you out.

 

Ilogic might be of help. We might be able to get the component position in the BOM and assign it to the part, not in iproperties but in the occurrence name (browser name) that is unique in the assembly. You can't use iproperties because a lot of the items are reused or in library, bolts washers, etc.

 

However this means that in stead of seeing the component part number and description (that's what I have setup as the name in the browser) you will see just a number, the BOM Item Number.

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 5 of 16
danmorick
in reply to: salariua

Thanks for the assistance.  Mostly I just wanted to make sure I wasn't just unaware of some basic Inventor BOM functionality.  It seems Inventor just doesn't do what I need it to do in this case.  But anyway, here's an example.

 

For instance, the biggest, most significant component in Assembly C is the one I would like to be listed first.  Following it would be smaller, accessory-type components that bolt to the main one.  The items toward the end of the list would be the smallest items, and purchased items such as sensors, bolts, nuts, washers, etc, would be at the bottom; they have no associated drawings and therefore the exact order is unimportant.  As it turns out, my main component has a part number / file name that puts it halfway down the list if sorted by part number (we use a sequential numbering system and the order with which the numbers were created and applied to components was not a consideration).

 

Now that assembly resides in Assembly B, which resides in the top-level Assembly A.  If I reorder Assembly C the way I want it, I do not see that new order when I look at all levels of Assembly B, or at all levels of Assembly A.  I have to create that order (manually, just as I did for C) at the level of Assembly B and at the top level Assembly A if I want the BOM export from Assembly A to correspond with the Parts Lists I see on drawings for Assemblies B and C.

 

I did come up with a quick and dirty ilogic method that creates a custom iproperty "TEMPITEMNUMBER" for each component in the BOM.  Its value is derived from the BOM row item number.  I run the rule in Assembly C after arranging it the way I want and renumbering (so component in row 1 has TEMPITEMNUMBER = "01", etc.).  Then I go to Assembly B's BOM and sort Assembly C's components by TEMPITEMNUMBER, ascending, and then renumber.  I do the same in Assembly A's BOM.  Then I go back to Assembly C and use ilogic to delete custom iproperty "TEMPITEMNUMBER" for each component.  It's not the smoothest process, but apparently the concept works.  I have to do this for each subassembly, at each level all the way to the top.

 

You might be on to something good with the occurrence name idea.  After it is used to sort the BOMs it presumably could be reset back to the default name.

Message 6 of 16
salariua
in reply to: danmorick

So it's a custom order you want them in. Normally Even after the restructure I decided to move them around based on the importance (like you said) and only then I do the re-numbering the item number. I use an add-in to renumber, re-allocate part numbers and it gets the sequence from the BOM structure. So as long as I drag them in the order I want I will have sequenced PN and FileName.

 

I guess you can use the occurrence name as a transition value and revert it to default at the end. I use valve and instrument taging this way and if I cancel the rename operation on the occurrence it reverts to default original value Smiley Wink

 

Here's the code I use:

 

Dim comp As Object

Try
	While True
		comp = ThisApplication.CommandManager.Pick(
			SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, 
			"Select a component") 
		oTagOcc = InputBox("Enter Tag No: ", "Tag Prompt", comp.Name)
			comp.Name = oTagOcc

	End While
Catch ' do nothing if error

End Try

 This will allow me to pick component and enter a new value. If I cancel the operation (even on renamed occurrences) it reverst to default asm value.

 

Edit:

 

here's the codify program I use:

http://blog.ads-sol.com/2014/03/mextension-codify-for-inventor.html

and here's the rename program:

http://blog.ads-sol.com/2014/02/mextension-rename-function-for-inventor.html

http://blog.ads-sol.com/2014/03/rename-some-more.html

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 7 of 16
tbachelder
in reply to: danmorick

Hey, I also like to arrange parts as major first then minor last, for example "base frame" as item 1, so I typically arrange drawing lists manually in it's lower level BOM. I wrote a macro that pulls in the item numbers of lower level boms and pulls them to the top structured bom. 

 

This macro will do what you want, I think. I posted it here:

http://forums.autodesk.com/t5/inventor-forum/sub-assembly-item-number-corruption/m-p/6774501#M625188

 

 

Message 8 of 16
Anonymous
in reply to: danmorick

I am using Inventor 2017 and seems like there is no change to automatically make main assembly's BOM structure to match with sub-assemblies's BOM structures. My problem is exactly the same as the original poster's from 2014 but any of those suggested workarounds is not suitable.

 

It definately should be a default setting that BOM lists match with each other in all levels. I hope a solution for this during my lifetime, thanks!

Message 9 of 16
johnsonshiue
in reply to: Anonymous

Hi Jani,

 

The request definitely makes sense but there is technical challenge. The top-level BOM does inherit BOM data and structure from lower levels. However, it may have other components which can change the order. Your proposal will work if the top-level assembly has the same subassemblies without other components.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 10 of 16
Anonymous
in reply to: johnsonshiue

Seems like I didnt explain myself right. Here I show an example of what I mean.
This is my BOM structure of my main assembly's "Structured" view and the "Strucured properties" set to "All levels"

1. Main assembly

1.1. Assembly Alpha

1.1.1. Screw

1.1.2. Nut

1.1.3. Plate

1.2. Components

1.3. Components

And now comes the BOM structure of my Sub-assembly named "Assembly Alpha"

1. Assembly Alpha

1.1. Plate

1.2. Screw

1.3. Nut
For some reason the Main assembly does not get the correct order of the components in sub-assembly Alpha. I have to manually change the order of the main assembly's structure to look like this:

1. Main assembly

1.1. Assembly Alpha

1.1.1. Plate

1.1.2. Screw

1.1.3. Nut

1.2. Components

1.3. Components
This should be automatic. I am experienced Inventor user and I know how "Reference", "Purchased", "Phantom" etc. works. Those things should not cause any trouble. For example, if I change the structure of the "Plate" to be a "reference", it just should disappear from the structure of "Assembly Alpha" and therefor also from "Main assembly".
Little research has shown that the main-assembly gets the BOM structure order chronologically. In this case, seems like the first component I placed to "assembly Alpha" was "Screw" as seen in beginning of this message.

I hope I made myself understood a little better now.

Best regards,
Jani Eskelinen

Message 11 of 16
tbachelder
in reply to: Anonymous

Message 12 of 16
Anonymous
in reply to: tbachelder

After small changes to this code it seems to work for me too. The macro is renumbering the items correctly but the order looks like this:

 

1. Assembly

    1.3 Part

    1.1 Another part

    1.2 One more part

 

Anyhow, this is enough for my needs so many thanks for you tbachelder!

Message 13 of 16
j.vdstouwe
in reply to: Anonymous

What modifications did you do for this marco? I get an error when I try to run this. See attached screen print.

Any solutions how to fix this? I am new into this macro buisiness.

 

 

Message 14 of 16
johnsonshiue
in reply to: j.vdstouwe

Hi! Just to double-check, have you turned on All-Level option (BOM -> Structured -> right-click on it -> View Properties -> Level = All Levels.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 15 of 16
j.vdstouwe
in reply to: johnsonshiue

Hello Johnson,

 

Yes this option is activated.

Message 16 of 16
travward
in reply to: j.vdstouwe

I had to make updates to the code after we upgraded to 2019. Here are my updates. Try it out and let me know if your error goes away.

 

Public Sub UpdateBomItemNumbersUpdated()
Dim oAsm As AssemblyDocument
Set oAsm = ThisApplication.ActiveDocument

'Sets LOD to Master
Dim oLOD As LevelOfDetailRepresentation
Set oLOD = oAsm.ComponentDefinition.RepresentationsManager.LevelOfDetailRepresentations.Item("Master")
oLOD.Activate (True)

Dim oBOM As BOM
Set oBOM = oAsm.ComponentDefinition.BOM

' Make sure it's enabled
oBOM.StructuredViewEnabled = True
oBOM.StructuredViewFirstLevelOnly = False

Dim oBOMView As BOMView
Set oBOMView = oBOM.BOMViews("Structured")

' iterate through top level bill to find "if not childrows is nothing"
' if childrow is not nothing then send through "iterate thru childrow" sub

' Call IterateFirstLevelRows(oBOMView.BOMRows)


Dim oTOPBOMRows As BOMRowsEnumerator
Set oTOPBOMRows = oBOMView.BOMRows

Dim oTOPBOMRow As BOMRow

For Each oTOPBOMRow In oTOPBOMRows
' Let's only get the first definition
' It would only be more than one if rows were merged

If Not oTOPBOMRow.ChildRows Is Nothing Then

Dim oCHILDBOM As BOM
Set oCHILDBOM = oTOPBOMRow.ComponentDefinitions(1).BOM

' Make sure it's enabled
oCHILDBOM.StructuredViewEnabled = True
oCHILDBOM.StructuredViewFirstLevelOnly = False

Dim oChildBOMView As BOMView
Set oChildBOMView = oCHILDBOM.BOMViews("Structured")

Call IterateThruRowsChildUpdated(oTOPBOMRow.ChildRows, oChildBOMView)

End If

Next

End Sub

Public Sub IterateThruRowsChildUpdated(oBOMRows As BOMRowsEnumerator, oChildBOMViews As BOMView)

'I think that the order of oBomRows reference instance was in the same order as oChildBomViews and by comparing the 2 and askin
'for the item numbers to match. But now they are not the same.


'Dim n As Integer
'n = 1

Dim oBOMRow As BOMRow

For Each oBOMRow In oBOMRows



'Here (I think) I needs to establish the name of the file and search the child rows for the same name and set oBomRow.ItemNumber
' to equal to that item number.

Dim b As Integer
Dim iChildBomCount As Integer


iChildBomCount = oChildBOMViews.BOMRows.Count

For b = 1 To iChildBomCount

If oBOMRow.ComponentDefinitions(1) Is oChildBOMViews.BOMRows(b).ComponentDefinitions(1) Then

Exit For

End If

Next b


If Not oBOMRow.ChildRows Is Nothing Then

oBOMRow.ItemNumber = oBOMRow.Parent.ItemNumber + "." + oChildBOMViews.BOMRows(b).ItemNumber

'n = n + 1

Dim oCHILDBOM As BOM
Set oCHILDBOM = oBOMRow.ComponentDefinitions(1).BOM

' Make sure it's enabled
oCHILDBOM.StructuredViewEnabled = True
oCHILDBOM.StructuredViewFirstLevelOnly = False

Dim oChildBOMView As BOMView
Set oChildBOMView = oCHILDBOM.BOMViews("Structured")

Call IterateThruRowsChildUpdated(oBOMRow.ChildRows, oChildBOMView)

Else

oBOMRow.ItemNumber = oChildBOMViews.BOMRows(b).ItemNumber

'n = n + 1

End If

Next

End Sub

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

Post to forums  

Autodesk Design & Make Report