Ilogic <= question

Ilogic <= question

c.lutz
Explorer Explorer
801 Views
3 Replies
Message 1 of 4

Ilogic <= question

c.lutz
Explorer
Explorer

 I'm relatively new to Ilogic, I have made a few parts and after an hour so of searching I cant find an answer to my question, I really don't even know how to correctly ask the question.

 

I'm trying to duplicate a suppliers ducting that uses the formula (A-B ≥ B-C)

 

Branch A is always the largest branch so I want to be able to make a form that when you select branch A's value (multi value list) it limits branch B and branch C to a value that is ≤ branch A.

 

I assumed it would be a simple

IF Branch A = ? Then               I don't know what to replace the ? with

Branch B is ≤ Branch A

 

 

0 Likes
802 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Branch A is your primary variable in this scenario so it will always be a user input value. If you are defining the contents of your multivalue list and its members won't be subject to change then you can either code an IF statement for every Branch A value or you could use a Case Select.

 

Beyond that, you need to evaluate all of your parameters to create logic that will adapt to some manner of dynamic change. For instance, if Branch B is always one size smaller than Branch A, you can set the Branch A multivalue list reference its list index number and assign the value of the preceding index to Branch B. 

 

Without knowing the finer details of your application though, it's difficult to offer much targeted help on the code side.

 

Please feel free to ask questions.

0 Likes
Message 3 of 4

Curtis_Waguespack
Consultant
Consultant

Hi c.lutz,

 

I think something like this should do it. See the attached example Inventor 2015 file and play around with the ilogic form.

 

'reset Branch B list to default
MultiValue.SetList("Branch_B", 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)

'reset Branch C list to default
MultiValue.SetList("Branch_C", 2,4,6,8,10,12,14,16)

Dim B_List As New ArrayList
B_List = MultiValue.List("Branch_B")

Dim C_List As New ArrayList
C_List = MultiValue.List("Branch_C")

Dim Temp_List As New ArrayList

Temp_List.Clear
For Each oItem in B_List
	If Branch_A >= oItem Then
		Temp_List.Add(oItem)
	End If
Next

MultiValue.List("Branch_B") = Temp_List

Temp_List.Clear
For Each oItem in C_List
	If Branch_A >= oItem Then
		Temp_List.Add(oItem)
	End If
Next

MultiValue.List("Branch_C") = Temp_List

 

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 4 of 4

c.lutz
Explorer
Explorer

Thanks Curtis I was in the process of this when you posted.... all the way up to 40"

 

MultiValue.SetValueOptions(True, DefaultIndex := 0, NumericCompare := "=") 

If BRANCH_A = 3 Then

MultiValue.SetList("BRANCH_C", 3) 
MultiValue.SetList("BRANCH_B", 3)

ElseIf BRANCH_A = 4 Then

MultiValue.SetList("BRANCH_C", 3, 4) 
MultiValue.SetList("BRANCH_B", 3, 4)

ElseIf BRANCH_A = 5 Then

MultiValue.SetList("BRANCH_C", 3, 4, 5) 
MultiValue.SetList("BRANCH_B", 3, 4, 5)

ElseIf BRANCH_A = 6 Then

MultiValue.SetList("BRANCH_C", 3, 4, 5, 6)
MultiValue.SetList("BRANCH_B", 3, 4, 5, 6)

ElseIf BRANCH_A = 7 Then

MultiValue.SetList("BRANCH_C", 3, 4, 5, 6, 7)
MultiValue.SetList("BRANCH_B", 3, 4, 5, 6, 7)

ElseIf BRANCH_A = 8 Then

MultiValue.SetList("BRANCH_C", 3, 4, 5, 6, 7, 8) 
MultiValue.SetList("BRANCH_B", 3, 4, 5, 6, 7, 8)
0 Likes