ilogic Configuartion form to BOMs

ilogic Configuartion form to BOMs

parth_moradiya
Contributor Contributor
366 Views
5 Replies
Message 1 of 6

ilogic Configuartion form to BOMs

parth_moradiya
Contributor
Contributor

I have created a assembly in inventor and also write code in ilogic for different variations for the assembly according to 4 different user parameters. now is it possible to export BOMs for each different variation like material or different bolt length and all? 

0 Likes
367 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor

Hi @parth_moradiya 

If you can do this manually you should be able to do this by code. Can you explain the manual steps your are carrying out? Some images will help in knowing what BOM settings you want to use. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 6

parth_moradiya
Contributor
Contributor

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

0 Likes
Message 4 of 6

A.Acheson
Mentor
Mentor

Is your form an ilogic form or built by visual studio (winform)? 

If it is an ilogic form then you just input the parameter in the form and they can be changed directly with no ilogic. An assuming your parameter is exported to iproperty the value wiol show up in the BOM.Can you show the form when it is in edit mode? 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 6

parth_moradiya
Contributor
Contributor

hi,

 

I have attached the ilogic form. problem is that I have used for example bolt with only one part number in it there is 5 different length. so when export it with any lenghts of bolt the bom then it is giving me same part number as I have used parameter to change bolt length. but I need different name or part number for all different bolt length when i export bom.

0 Likes
Message 6 of 6

A.Acheson
Mentor
Mentor

In that case you can use the parameter value to trigger a partnumber/description change. See below example. Keep in mind you will need to place each unique occurrence using ilogic place component or use save and replace in order not to overwrite the BOM of an already placed occurrence. 

 

Select Case length
	Case "100" 
		iProperties.Value("Project", "100")
	Case "125" 
		iProperties.Value("Project", "125")
End Select  

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan