I had a quick look at this. It seems when your looking to display the parameter value using the local document parameter ( blue in the editor) the value is not completely up to date. It seems to be one case statement behind at times. Only running the rule twice will get this to display the correct pitch per chainSize
MessageBox.Show(ChainSize & vbLf & Pitch, "after case statement")
This test is backed up by the help document information stating
Parameter.UpdateAfterChange = True
True will cause the model (document) to Update after a parameter value is changed by the Parameter function. This only takes effect when you change parameters using the Parameter function. For example:
Replacing the local parameter with the parameter function of " Parameter("Pitch")" will give you the updated value each time.
MessageBox.Show(ChainSize & vbLf & Parameter("Pitch"), "after case statement") This is working
'set value to update model after parameter change
Parameter.UpdateAfterChange = True
Select Case ChainSize 'drop down in Parameters
Case "40"
Parameter("Pitch") = .500
Parameter("RollerD") = .312
Parameter("RollerW") = .312
Parameter("PinD") = .156
Parameter("PinW") = .642
Parameter("PlateT") = .058
Parameter("PlateH") = .475
Case "50"
Parameter("Pitch")= .625
Parameter("RollerD") = .400
Parameter("RollerW") = .375
Parameter("PinD") = .200
Parameter("PinW") = .794
Parameter("PlateT") = .079
Parameter("PlateH") = .594
Case "60"
Parameter("Pitch") = .750
Parameter("RollerD") = .469
Parameter("RollerW") = .500
Parameter("PinD") = .234
Parameter("PinW") = .994
Parameter("PlateT") = .093
Parameter("PlateH") = .712
Case "80"
Parameter("Pitch") = 1.000
Parameter("RollerD") = .625
Parameter("RollerW") = .625
Parameter("PinD") = .312
Parameter("PinW") = 1.290
Parameter("PlateT") = .125
Parameter("PlateH") = .950
End Select
MessageBox.Show(ChainSize & vbLf & Parameter("Pitch"), "after case statement")
Or if you keep using the local parameter value without the function like this
'set value to update model after parameter change
Parameter.UpdateAfterChange = True
Select Case ChainSize 'drop down in Parameters
Case "40"
Pitch = .500
Parameter("RollerD") = .312
Parameter("RollerW") = .312
Parameter("PinD") = .156
Parameter("PinW") = .642
Parameter("PlateT") = .058
Parameter("PlateH") = .475
Case "50"
Pitch = .625
Parameter("RollerD") = .400
Parameter("RollerW") = .375
Parameter("PinD") = .200
Parameter("PinW") = .794
Parameter("PlateT") = .079
Parameter("PlateH") = .594
Case "60"
Pitch = .750
Parameter("RollerD") = .469
Parameter("RollerW") = .500
Parameter("PinD") = .234
Parameter("PinW") = .994
Parameter("PlateT") = .093
Parameter("PlateH") = .712
Case "80"
Pitch = 1.000
Parameter("RollerD") = .625
Parameter("RollerW") = .625
Parameter("PinD") = .312
Parameter("PinW") = 1.290
Parameter("PlateT") = .125
Parameter("PlateH") = .950
End Select
MessageBox.Show(ChainSize & vbLf & Pitch, "after case statement")
'immediately update model with the above parameters
RuleParametersOutput()
InventorVb.DocumentUpdate()
It seems the mixing of the local parameter and parameter functions methods is what causes the issues. If you use one or the other it works.
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan