Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic range between two numbers; not working

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
RemcoVerschuren
2255 Views, 2 Replies

iLogic range between two numbers; not working

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

 

 

Tags (2)
2 REPLIES 2
Message 2 of 3
mrattray
in reply to: RemcoVerschuren

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.

Mike (not Matt) Rattray

Message 3 of 3
RemcoVerschuren
in reply to: mrattray

Great!

Moving the Parameter rule is solving the problem.

 

Thanks mrattray Smiley Wink

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report