Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

iLogic rule not running automaticly

Anonymous

iLogic rule not running automaticly

Anonymous
Not applicable

Hello all fellow Inventor users!

 

Being new to this forum and new to the usage of iLogic bear with me if I do things stupidly and feel free to advice me in the right direction.

 

I am working on a assembly with multiple rings whereby I can change the diameter of these rings through selecting a DN size using a form. The rings are made through skeletal modelling and every ring has their own diameter parameter. Then I also made a text parameter for every ring with the different DN sizes.

 

I first wrote out the code completely and then the model would update automaticly when changing the form parameters. I wanted to reduce the code by creating a loop but now I have run to run the rule and update de model by clicking manually.

 

I hope someone has a solution for me!

 

 

For x =1  To 12

If Parameter("dn" & x) = "DN45  ⌀51" Then
	Parameter("DIA" & x) = 76

ElseIf Parameter("dn" & x) = "DN50  ⌀60" Then
Parameter("DIA" & x) = 83

ElseIf Parameter("dn" & x) = "DN65  ⌀76" Then
Parameter("DIA" & x) = 99

ElseIf Parameter("dn" & x) = "DN80  ⌀89" Then
Parameter("DIA" & x) = 110

ElseIf Parameter("dn" & x) = "DN90  ⌀102" Then
Parameter("DIA" & x) = 126

ElseIf Parameter("dn" & x) = "DN100  ⌀114" Then
Parameter("DIA" & x) = 140

ElseIf Parameter("dn" & x) = "DN105  ⌀121" Then
Parameter("DIA" & x) = 148

ElseIf Parameter("dn" & x) = "DN125  ⌀139" Then
Parameter("DIA" & x) = 173

ElseIf Parameter("dn" & x) = "DN145  ⌀152" Then
Parameter("DIA" & x) = 190

ElseIf Parameter("dn" & x) = "DN150  ⌀168" Then
Parameter("DIA" & x) = 207

ElseIf Parameter("dn" & x) = "DN200  ⌀219" Then
Parameter("DIA" & x) = 255

End If
Next 

 

0 Likes
Reply
313 Views
2 Replies
Replies (2)

johnsonshiue
Community Manager
Community Manager

Hi! The alternative is to use Select Case. But, you won't save much code. It is because you do have unique cases and each case has a unique action.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes

Anonymous
Not applicable

Would this solve the problem of the rule not running automaticly? Also I'm not super familiar with the function select case. Maybe if you could show me a part of the code.

 

Thanks in regards

0 Likes