Inventor General Discussion

Reply
Member
RemcoVerschuren
Posts: 5
Registered: ‎02-19-2013
Message 1 of 3 (380 Views)
Accepted Solution

iLogic range between two numbers; not working

380 Views, 2 Replies
04-03-2013 03:05 AM

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

 

 

*Expert Elite*
mrattray
Posts: 2,470
Registered: ‎09-13-2011
Message 2 of 3 (363 Views)

Re: iLogic range between two numbers; not working

04-03-2013 04:27 AM 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

Member
RemcoVerschuren
Posts: 5
Registered: ‎02-19-2013
Message 3 of 3 (356 Views)

Re: iLogic range between two numbers; not working

04-03-2013 04:35 AM in reply to: mrattray

Great!

Moving the Parameter rule is solving the problem.

 

Thanks mrattray :smileywink:

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube