I am thinking that the idea of a spare parts sub assembly from @Frederick_Law is the most straight forward and easy to use approach. I am not totally sure of your process for creating qty's for purchasing and how your displaying the BOM to the Assembly crew so really there is many way's you can work with the assembly approach. Either directly in the BOM or in the Partlist in the drawing.
Some potential workflows in the BOM:
- You could just have the assembly completely independent of the main assembly and in your BOM export to excel combine the parts qtys either manually or by code. Obviously this might not be a very transparent method and open to mistakes.
- Create a sub assembly in the main assembly and add physical parts to the assembly. This way the total counts for BOM export are correct for purchasing. This however brings a drawback in that the qty's for assembly purposes are now incorrect as they include the spare parts and there maybe confusion as to the extra qty's. A solution is to set the Sub assembly Bom Structure to Normal in the assembly when exporting BOM for ordering then switch the Occurrence Bom Structure to reference afterwards for Assembly Accuracy in the Drawing.
Manual approach to solve the qty potential confusion.

And here is an optional code method to work with a spare parts sub assembly. I have chosen to add correct qty's of occurrences as the mass is then correct for the assembly in case you want to check shipping requirements etc.
Dim oAssyDoc As AssemblyDocument = ThisDoc.Document
Dim oAssyDef As AssemblyComponentDefinition = oAssyDoc.ComponentDefinition
'Set Name of Spare parts Assembly
Dim NewFullFileName As String = ThisDoc.Path & "\" & ThisDoc.FileName(False) & "-SpareParts.iam"
Dim oSpareAssyDoc As AssemblyDocument
Dim oSpareAssyOcc As ComponentOccurrence
Dim oMat As Matrix = ThisApplication.TransientGeometry.CreateMatrix
For Each oRefDoc As Document In oAssyDoc.ReferencedDocuments
If NewFullFileName = oRefDoc.FullFileName Then
oSpareAssyDoc = oRefDoc
Dim RefOccs As ComponentOccurrencesEnumerator = oAssyDef.Occurrences.AllReferencedOccurrences(oRefDoc)
oSpareAssyOcc = RefOccs(1)
Exit For
End If
Next
If oSpareAssyDoc Is Nothing Then
'Check if you have allready create an assembly on Disc
If Not IO.File.Exists(NewFullFileName) Then
' Create a new sub-assembly
oSpareAssyDoc = ThisApplication.Documents.Add(kAssemblyDocumentObject, , False)
oSpareAssyDoc.SaveAs(NewFullFileName, False)
' Create an instance Of the New Sub-assembly
oSpareAssyOcc = oAssyDef.Occurrences.AddByComponentDefinition(oSpareAssyDoc.ComponentDefinition, oMat)
Else
' Create an instance Of the New Sub-assembly
oSpareAssyOcc = oAssyDef.Occurrences.Add(NewFullFileName, oMat)
oSpareAssyDoc = oSpareAssyOcc.Definition.Document
End If
End If
'Set This Occurrence to Reference in the context of Main Assembly
'oSpareAssyOcc.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
'[Selecting Component using Pick
While True
Dim oSparePartoOcc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter,"Select a Part to add to the Assembly, Press Esc when Complete")
' If nothing gets selected then we're done
If IsNothing(oSparePartoOcc) Then Exit While
Dim Qty As Integer = InputBox("Current Qty Below, Enter A New Qty?", oSparePartoOcc.Name, "1")
Dim i As Integer
For i= 1 To Qty
' Create an instance of the new sub-assembly
oSpareAssyOcc.Definition.Occurrences.AddByComponentDefinition(oSparePartoOcc.Definition, oMat)
Next
End While
']
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan