Imports Inventor.UnitsTypeEnum
'Dim kDefaultBOMStructure As Integer = 51969 ''The Default Structure type.
'kInseparableBOMStructure 51974 The inseparable Structure type.
'kNormalBOMStructure 51970 The normal Structure type.
'kPhantomBOMStructure 51971 The phantom Structure type.
'kReferenceBOMStructure 51972 The reference Structure type.
'kPurchasedBOMStructure 51973 The purchased Structure type.
Dim oPartDoc As Document
oPartDoc = ThisDoc.Document
If oPartDoc.DocumentType <> kPartDocumentObject Then
MessageBox.Show("This is not a part document", "Document type")
End If
If oPartDoc.DocumentType = kPartDocumentObject Then
Dim oPartCompDef As PartComponentDefinition
oPartCompDef = oPartDoc.ComponentDefinition
Dim oParams As Parameters
oParams=oPartCompDef.Parameters
Dim oUserParams As UserParameters
oUserParams=oParams.UserParameters
Try
otester = oUserParams.Item("BOMs")
Catch
oInsulationType=oUserParams.AddByValue("BOMs", "Normal", kTextUnits)
MultiValue.SetList("BOMs", "Normal", "Phantom", "Reference", "Purchaced")
End Try
End If
iLogicVb.UpdateWhenDone = True
Dim MYCHOISE As String = InputListBox("Make a choise...", MultiValue.List("BOMs"), BOMs, Title := "PART BOM", ListName := "List")
If MYCHOISE = "Purchaced" Then
oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kPurchasedBOMStructure
Else If MYCHOISE = "Normal" Then
oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kNormalBOMStructure
Else If MYCHOISE ="Phantom" Then
oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kPhantomBOMStructure
Else If MYCHOISE ="Reference" Then
oPartDoc.ComponentDefinition.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
End If
oPartDoc.ComponentDefinition.Parameters.Item("BOMs").delete
iLogicVb.UpdateWhenDone = True