How to control max and min value of a dimension?

How to control max and min value of a dimension?

ikilic1461
Enthusiast Enthusiast
1,232 Views
2 Replies
Message 1 of 3

How to control max and min value of a dimension?

ikilic1461
Enthusiast
Enthusiast

Hi;

I would like to control one of my parameter in Inventor. (in equation or ilogic rule)

For example  my parameter is A2 and I want to limit that parameter within 200 and 500

200<A2<500 

0 Likes
Accepted solutions (2)
1,233 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @ikilic1461.  Here is some iLogic code you can use as a 'local' rule in that document.  If the parameter's name is "A2", then when you use that unquoted name within a 'local' rule, it will trigger that rule to run any time the value of that parameter changes.  Then this rule should effectively & automatically keep the value of that parameter within the range specified.  However, keep in mind that raw numbers in iLogic that represent measurements, will automatically be understood by Inventor as 'database' units (metric base units >>> length = centimeters, angle = radians, mass = grams, etc.)  So you may have to play with the numbers within the rule to get the 'units' to work out as you need them to.

Here's the iLogic rule code:

If A2 < 200 Then
	MsgBox("A2 must be within 200 to 500." & vbCrLf & _
	"Lower values will be set to 200.",vbInformation,"Parameter Police")
	A2 = 200
ElseIf A2 > 500 Then
	MsgBox("A2 must be within 200 to 500." & vbCrLf & _
	"Higher values will be set to 500.",vbInformation,"Parameter Police")
	A2 = 500
End If

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

ikilic1461
Enthusiast
Enthusiast
Accepted solution

Thank you. It worked well.

0 Likes