Hi,
I would like to use the if else parameter in iLogic to set up a range, but I'm not getting it right.
Maybe you got any idea?
What should happen:
if the variable 'breedte' is:
- 0 up to 3800; thats OK
- 3800 up to 4000; thats not OK, use 3800 instead
- 4000 and up; thats OK
Therefore I wrote this script, but when I enter a number between 3800 and 4000 (like 3900), the MessageBox appears (thats good), but the size of my solid results in 3900, instead of 3800.
breedte = InputBox("What is the breedte?", "Hoofdmaten", "") Parameter("skelet.ipt.breedte")=breedte If breedte <= 3800 Then breedte = breedte Else If breedte >= 4000 Then breedte = breedte Else If (breedte >= 3801) AndAlso (breedte <= 4000) Then breedte = 3800 MessageBox.Show("This breedte is not possible." & hoogte & vbCr & "The value of 3800 will be used instead.", "Problem message", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) End If
Solved! Go to Solution.
Solved by mrattray. Go to Solution.
Well I would write this as :
breedte = InputBox("What is the breedte?", "Hoofdmaten", "") If breedte > 3800 and breedte < 4000 Then breedte = 3800 MessageBox.Show("This breedte is not possible." & hoogte & vbCr & "The value of 3800 will be used instead.", "Problem message", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) End If Parameter("skelet.ipt.breedte")=breedte
I think the issue is from setting the value in your skeleton part before you did your error check.