Structured BOM Total Quantity of Loose Components

Structured BOM Total Quantity of Loose Components

emanuel.c
Collaborator Collaborator
722 Views
10 Replies
Message 1 of 11

Structured BOM Total Quantity of Loose Components

emanuel.c
Collaborator
Collaborator

My question is similar to the one asked here: https://forums.autodesk.com/t5/inventor-forum/structured-bom-total-quantity-component-level/m-p/1145...

 

However I'm not interested in the "Parts Only" BOM structure but in a list of all the components of an assembly that could be split down to a weldment (or even lowest level assembly) or loose part. Is this possible?

 

If an Assembly looks like this:

 

Main Assembly

  • Sub-Assembly 1 – 1pc
    • Weldment 1 – 1pc
    • Part 1 – 1pc
  • Sub-Assembly 2 - 1pc
    • Weldment 1 – 1pc
    • Part 1 – 1pc
  • Part 1 – 1pc

I would like to see a BOM view of:

  • Weldment 1 – 2pc
  • Part 1 – 3pc

 

0 Likes
Accepted solutions (1)
723 Views
10 Replies
Replies (10)
Message 2 of 11

mslosar
Advisor
Advisor

Set Sub-Assembly 1 and 2 to be phantom assemblies while using the structured BOM view.

0 Likes
Message 3 of 11

emanuel.c
Collaborator
Collaborator

Maybe I should explain my need for this. The components will be shipped as Assemblies. As such I have grouped them in Sub-Assemblies and under BOM->Structured this serves my needs well. It keeps the Main Assembly better structured.

 

But for fabricating, the shop needs a total quantity of Weldments in this Main Assembly which need to be fabricated. If it is a small assembly it is no big deal, we can do a little math. In this case it is a large assembly containing over a hundred weldments and hundreds of loose components. Some of the weldments are used in multiple assemblies and multiple times.

 

I wish there was an easy way to print out a Parts List which would show only those, a list with total quantities of all unique weldments to be fabricated. Sure it could have the rest of the loose parts as well, I can sort it out.

 

I hope it brings some clarity. Thank you!

 

0 Likes
Message 4 of 11

johnsonshiue
Community Manager
Community Manager

Hi Emauel,

 

I don't believe Inventor has an out-of-the-box workflow to do what you are looking for. The closest workflow is to export the Weld Bead report as an xls file and export the BOM. You may combine the two spreadsheet manually.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 5 of 11

emanuel.c
Collaborator
Collaborator

Hello   @johnsonshiue,

 

Thank you for the response. On top of this some of the weldments might actually not be drawn as a "Weldment" type of Asssembly. As such I wouldn't even have weld beads for all.

 

I really wish there was some way to do this, to be able to know the assemblies / weldments and their quantities at the lowest (basic) level, without having to rely on Excel and manual figuring. Perhaps it would require a 4th type of BOM structure, where you could actually set which is the lowest level of an assembly / weldment.

 

Thanks!

0 Likes
Message 6 of 11

jeremy_wasserstrass
Advocate
Advocate
Accepted solution

I found a rule on the forums a while back that kind of does that. The caveat is that it does not count CC parts as they are read only and the rule writes back a project iproperty with a quantity to all components.

 

'01/03/2017
'Reg Hasell.
'This iLogic rule will run though all the items in an assembly and add a QTY field to it.
'The QTY field is based on a programmable project number. (project_QTY)
'Any Content Center items are ignored. (Read Only)
'There is an option to set the project number.
'
'Some of this code has originated from the forum, but I cannot
'remember where I got it from, so I am unable To give credit To the original author.

Sub Main ()
	'Check to see if this document is an assembly.
	oDoc = ThisApplication.ActiveDocument
		If oDoc.DocumentType <> kAssemblyDocumentObject Then
		MessageBox.Show("This rule can only be run in an Assembly file - exiting rule...", "GDI iLogic")
		Return
		End If
	If iProperties.Value("Project", "Project")=""
		oProj = InputBox("Change Project Name", "Project Name", iProperties.Value("Project", "Project"))
		iProperties.Value("Project", "Project")=oProj
	End If

'get the project number of this assembly and use it to build the name of a custom property, i.e. "4100_QTY"
customPropertyName = CStr(iProperties.Value("Project", "Project")) & "_QTY"

	oQ=MessageBox.Show(customPropertyName, "Project Number",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Question)
		If oQ=vbYes
		oDone()
		ElseIf oQ=vbNo
		Call oProject
		ElseIf oQ=vbCancel
		MessageBox.Show("Cancelled", "GDI iLogic", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
		Return
	End If
End Sub

Sub oDone
oCompDef = ThisDoc.Document.ComponentDefinition
openDoc = ThisDoc.Document
customPropertyName = CStr(iProperties.Value("Project", "Project")) & "_QTY"
'Open the document that inventor has in focus right now
    For Each docFile In openDoc.AllReferencedDocuments

	'FNamePos is getting the number of spaces that it takes to get to the 
    'very last back slash in the full file name of our document.         
        FNamePos = InStrRev(docFile.FullFileName, "\", -1)        
     
	'We can then take that number (position) and use it to cut off all of the 
    'file path that we don't need. In this case, it's the front of the path
    'that we're getting rid of, leaving us with just the file name.
        docFName = Mid(docFile.FullFileName, FNamePos + 1, Len(docFile.FullFileName) - FNamePos)
        
        'Let's make sure that we can even change this part. If we can, then we'll continue. 
        If docFile.IsModifiable = True Then
            
            'Because you can only grab the occurrences from an assembly document
            'we need to fill up that empty AssemblyDocument container with an object
            'that we know is definitely an assembly document. Because that was one
            'of the first checks we made up there on this open document, we can safely
            'declare that assemblyDoc (Which is an AssemblyDocument) is equal to 
            ' openDoc (Which is just a regular old Document)             
            assemblyDoc = openDoc        
            
            'While we're at it, let's go on and define the empty ComponentDefinition container
            '(we named ours assemblyDef) with some sort of content. 
            assemblyDef = assemblyDoc.ComponentDefinition
            
            'Now we need to collect every instance of the document against
            'our open assembly and put them all inside of partQty. 
            partQty = assemblyDef.Occurrences.AllReferencedOccurrences(docFile)
            
                'Now that we have our collection of instances, we need to populate
                'our target iproperty with the total amount. 
                
                'Instead of just throwing that amount in there, let's make sure that
                'the value inside of the target iProperty isn't already equal to our count. 
                'If it is equal, then we don't have to change anything (which saves us time!),
                'but if it isn't equal then we will need to change it. 
                
                'The Try statement is here because of the next if statement ---
               
                'If we just compare the two values, there is a small chance that our target
                'iProperty is already set to something that is NOT a number, which would create
                'an error (as you can't compare numbers against things that aren't numbers). 
                'So, we TRY to complete that if statement, and if there is an error (The CATCH)
                'we just force that target to equal our part qty total. 
                Try
						If partQty.Count <>  iProperties.Value(docFName, "Custom", customPropertyName) Then                
						iProperties.Value(docFName, "Custom", customPropertyName) = partQty.Count
                    End If                      
                    Catch
					iProperties.Value(docFName, "Custom", customPropertyName) = partQty.Count
                End Try
        End If
    Next
'29/01/2016
'I added the following to create the value for the GA
'Some code automation in the Detailing environment was
'failing because it could not find a valid entry.
'This is a dummy field, and does not contribute to the rest of the inteligence of the rule.
			Try
				oASSYParam= iProperties.Value("Custom",customPropertyName)
              Catch
				iProperties.Value("Custom",customPropertyName) = "1"
					End Try
iLogicVb.UpdateWhenDone = True 
MessageBox.Show("Completed" & vbNewLine & ":-)", "Completed", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
End Sub

Sub oProject
	oProj = InputBox("Change Project Name", "Project Name", iProperties.Value("Project", "Project"))
	iProperties.Value("Project", "Project")=oProj
	Main ()
End Sub	

 

Using Inventor 2026 on Windows 11

Ideas needing support: spur gear tooth profile, rack gears generator
Message 7 of 11

emanuel.c
Collaborator
Collaborator

Hi  @jeremy_wasserstrass,

 

Thank you very much for the code! It does the job very well. I didn't think about using iLogic for this but I can modify it to suit my needs. I'm not certain it wouldn't work on content center issued files - I can write custom iProperties to CC files without an issue.

 

I can name it differently and add a custom column on the drawing's Part's List to include the total quantity for the project.

 

I'll say this issue is solved for me.

Have a nice day!

0 Likes
Message 8 of 11

jeremy_wasserstrass
Advocate
Advocate

Let me know what you come up with as I would be interested in seeing what you come up with if you can make it work with the CC parts. Just remembered, Iparts are also another thing that it does not count for me.

Using Inventor 2026 on Windows 11

Ideas needing support: spur gear tooth profile, rack gears generator
0 Likes
Message 9 of 11

emanuel.c
Collaborator
Collaborator

@jeremy_wasserstrass, I should mention that indeed you can't write to CC parts if they are placed under a folder specifically named "Content Center". For this reason I never place them in that folder. I either copy them to a new location, for example copy all fasteners to a folder named "Fasteners" or do something to avoid parts locked under "Content Center". I typically write certain iProperties to all parts and cannot have them un-writable.

 

As such, the code works perfectly well for them too, since they are treated as regular parts if they're not placed under a "Content Center" folder.

 

I'm only modifying the code slightly, for example I need the iProperty to be called "Total per machine". Next I need to modify the drawings so that the Parts List includes this iProperty. For this purpose I'll create a new drawings template and batch process the drawings (more than 700 at this time) to replace the template, re-organize Parts List and reprint PDFs. I suppose I could create a new Parts List style and activate that, but for me, it's easier to just replace the template.

 

I don't know if any of this would be helpful to you, but this is what I meant by slight modifications.

0 Likes
Message 10 of 11

jeremy_wasserstrass
Advocate
Advocate

Never would have thought of moving the fasteners to a different folder. So just to make sure I'm understanding, when you make a new Fastener instead of copying it within the CC folder you are saving the family table to your fastener folder. Is that a correct statement? Then I would imagine that your fastener folder lives within the same parent folder as the CC, Catalog, Design Data, ect. I do wonder how well a "Total per machine" iproperty will work, one of the nice things that we realized is a small benefit is that by using our project number for the iproperty name is that we can see where, and how many of our "common parts" are used.

 

Using Inventor 2026 on Windows 11

Ideas needing support: spur gear tooth profile, rack gears generator
0 Likes
Message 11 of 11

emanuel.c
Collaborator
Collaborator

So I add parts from CC to the assembly (in this case they'll be placed in the "Content Center" folder, under their family name). When the project nears completion I can rename that folder to be something else and thus writable. Inventor will automatically create a new "Content Center" folder which now will be empty. If I need to add new parts to CC from here on I move those parts from the "Content Center" folder to the "Fasteners". I have the project set to write a "Content Center" folder in each project, but not the Design Data, Catalog etc. - those are read from a different location.

 

But most often I already have a rich enough folder of fasteners that I can copy from another project. I start with placing that in my new project and using fasteners in an assembly from it. Later I can "Pack and Go" to save just what I need for that project.

 

Perhaps you can find a better way to do it, this is just what I do. Bear in mind that we're a small company and usually work one person per project, so there isn't much chance of conflicts or other issues with this workflow.

 

Secondly, we use the field "Project" - "Project" for something else in our company so I couldn't use it to write the new iProperty as "*Project* - QTY". It works better to write an iProperty "Total Per Machine" and use this in the Parts List. Also I would have to change the drawing Parts List style to include the new iProperty "*Project* - QTY" for each new Project as that number would change.

 

I hope this helps.

 

 

0 Likes