Changing iPart with iLogic

Changing iPart with iLogic

Nauld1
Enthusiast Enthusiast
474 Views
3 Replies
Message 1 of 4

Changing iPart with iLogic

Nauld1
Enthusiast
Enthusiast

So I wrote the Following iLogic:

 

If Crosstie_Depth = True And UG_Height = 132 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-01")
End If
If Crosstie_Depth = True And UG_Height = 168 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-05")
End If
If Crosstie_Depth = True And UG_Height = 192 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-09")
End If
If Crosstie_Depth = False And UG_Height = 132 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-03")
End If
If Crosstie_Depth = True And UG_Height = 168 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-07")
End If
If Crosstie_Depth = True And UG_Height = 192 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-11")
End If

It's supposed to change the height of a post and the spacing of holes on the post based on set parameters. There doesn't seem to be any errors with the program itself, but when I change my parameters the iPart won't change. Anyone have any ideas why?

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

Nauld1
Enthusiast
Enthusiast
If Crosstie_Depth = True And UG_Height = 132 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-01")
End If
If Crosstie_Depth = True And UG_Height = 168 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-05")
End If
If Crosstie_Depth = True And UG_Height = 192 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-09")
End If
If Crosstie_Depth = False And UG_Height = 132 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-03")
End If
If Crosstie_Depth = False And UG_Height = 168 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-07")
End If
If Crosstie_Depth = False And UG_Height = 192 in Then
iPart.ChangeRow("ML2005_iAssembly:5", "ML2005_iAssembly-11")
End If

 Sorry this is the actual iLogic

0 Likes
Message 3 of 4

tolgay.hickiran
Advisor
Advisor
Try to do the list with SELECT CASE rather then If then end if

Some worthwhile ideas
Copy Design should rename ilogic Rules too!
Why Nastran In-CAD doesn't have an SDK?IMPLEMENTED!

Tolgay Hickiran
Founding Partner
SignatureSignature

website
emailskypelinkedinyoutubeemail

0 Likes
Message 4 of 4

HermJan.Otterman
Advisor
Advisor
It should work but only one time. After that the name in the browser has changed??. You first need to change the name in the browser to for example "ML2005-5" put this also in your code. And use only one if then ELSE. Put in front of the second and following if's "else" and remove all the "end if" except for the last one..
If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes