How to prevent parameter (prefilled by iLogic rule) exceeds another keyparameter

How to prevent parameter (prefilled by iLogic rule) exceeds another keyparameter

BRLMCHKD
Advocate Advocate
594 Views
5 Replies
Message 1 of 6

How to prevent parameter (prefilled by iLogic rule) exceeds another keyparameter

BRLMCHKD
Advocate
Advocate

Hi Forum.

Could anyone give me a idea, how I do make sure, that my parameter

'LinerDiaMachined' (prefilled by rule) never exceeds another key-parameter 'LinerDia'

see attached screenshot.

Thanks,

BRL

2018-07-03_LinerDiaMachined must never exceeds LinerDia.jpg

kelly.young has embedded your image for clarity.

0 Likes
595 Views
5 Replies
Replies (5)
Message 2 of 6

johnsonshiue
Community Manager
Community Manager

Hi! I guess you may need to add a conditional statement in the iLogic rule to prevent the input parameter from exceeding the key parameter. I am not sure if there is a way to set a dynamic range in the UI. But, having a maximum value should be doable.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 3 of 6

Curtis_Waguespack
Consultant
Consultant

Hi @BRLMCHKD,

 

Something like this would work. I've taken some guesses as to the intent, so adjust as needed.

 

Also just as a tip, programming questions of this type are likely better placed on the Inventor Customization forum :
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Answer = MessageBox.Show("Liner requires machining!", _
"Attention",MessageBoxButtons.YesNo,MessageBoxIcon.Exclamation)

If Answer = vbYes Then 
	LinerDia = InputBox("Diameter OD", "Liner Machined", )
	
	If LinerDiaMachined > LinerDia Then 
		LinerDiaMachined = LinerDia - 0.125
		MessageBox.Show("Machined diameter cannot exceed OD." _
		& vbLf & "Machined diameter adjusted to: " & LinerDiaMachined , "ilogic")		
	End If
Else
	MessageBox.Show("Change ratio ...", "ilogic")
End If

 

EESignature

Message 4 of 6

mcgyvr
Consultant
Consultant

I went with this "While" statement..

 Needs a LinerDiaSet True/false parameter

It will keep prompting for the value until it meets the "less than" condition...

 

Answer1 = MessageBox.Show("Set diameter for liner machining operation? ", "Set diameter" ,MessageBoxButtons.YesNo)
If Answer1 = vbYes Then
	LinerDiaSet = False
While LinerDia < LinerDiaMachined Or LinerDiaSet = False
	LinerDiaMachined = InputBox("Enter LinerDia . Must be less than " & LinerDia, "Title", "1")
	iLogicVb.UpdateWhenDone = True
 	LinerDiaSet = True
End While
Else
	Return
End If


-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 5 of 6

BRLMCHKD
Advocate
Advocate

Hi Johnson

 

Thank you very much 🙂

 

I will try some of the received suggestions right away.

 

Have a nice day.

 

KR Bent

0 Likes
Message 6 of 6

dgreatice
Collaborator
Collaborator

Hi,

 

I think this while will no end loop.

 

Try :

 

CheckAndGet = InputBox("Input", "Title", LinerDiaMachined)
CheckResult = False

Do Until CheckResult = True
	If CheckAndGet >= LinerDia Then
		CheckAndGet = InputBox("Input", "Title", LinerDiaMachined)
		CheckResult = False
	Else
		CheckResult = True
		LinerDiaMachined = CheckAndGet
	End If
Loop

iLogicVb.UpdateWhenDone = True

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014