So as per pic attached, I have created a form. now I want to create bom for each variation selected in form. basically capture form data and convert it to bom. but now if I select bom option in it is giving me same bom for all variation even there is code for different length of bolt and material are different. i was using code below that i donot know right or wrong but i am getting it from here and there.
Define the main types and their values
Dim Lock_Form() As String = {"1", "2", "3", "4"}
Dim Material() As String = {"Brass", "Stainless Steel"}
Dim Bolt_Length() As String = {"0mm", "6.35mm", "12.5mm", "19.05mm", "25.4mm"}
Dim Lock_Type() As String = {"FS", "Q"}
' Get the selected values from the form
Dim selectedLockForm As String = Conf.Controls("Lock_Form").Value
Dim selectedMaterial As String = Conf.Controls("Material").Value
Dim selectedBoltLength As String = Conf.Controls("Bolt_Length").Value
Dim selectedLockType As String = Conf.Controls("Lock_Type").Value
' Generate BOM based on selected values
Dim bomName As String = "BOM_" & selectedLockForm & "_" & selectedMaterial & "_" & selectedBoltLength & "_" & selectedLockType
' Assign BOM to parts or assemblies based on selected values
For Each part As ComponentOccurrence In ThisApplication.ActiveDocument.ComponentDefinition.Occurrences
' Check for the part type and assign BOM accordingly
Select Case part.Name
Case "Lock_Form"
If part.Name = selectedLockForm Then
part.BOMStructure = bomName
End If
Case "Material"
If part.Name = selectedMaterial Then
part.BOMStructure = bomName
End If
Case "Bolt_Length"
If part.Name = selectedBoltLength Then
part.BOMStructure = bomName
End If
Case "Lock_Type"
If part.Name = selectedLockType Then
part.BOMStructure = bomName
End If
End Select
Next