Coding For dropdown in Ilogic Form.

Coding For dropdown in Ilogic Form.

smanionDV2GJ
Contributor Contributor
482 Views
3 Replies
Message 1 of 4

Coding For dropdown in Ilogic Form.

smanionDV2GJ
Contributor
Contributor
Hi, I am trying to make a parametric in Inventor that allows me to choose Half Lap, Full, Lap or Corner To Corner from a drop down menu in an ilogic form and changes a corner seam value. My current code that I've pasted below will only run the code for the corner to corner. I have tried with and without the multivalue update code and I get the same results. How can I remedy this? 


If
Style = "HALF LAP" Then Parameter("Corner1") = 0.5 Parameter("Corner2") = 0.5 Parameter("Corner3") = 0.5 Parameter("Corner4") = 0.5 MultiValue.UpdateAfterChange = True Else If Style = "FULL LAP" Then Parameter("Corner1") = 0.2 Parameter("Corner2") = 0.2 Parameter("Corner3") = 0.2 Parameter("Corner4") = 0.2 MultiValue.UpdateAfterChange = True Else If Style = "CORNER TO CORNER" Then Parameter("Corner1") = 1 Parameter("Corner2") = 1 Parameter("Corner3") = 1 Parameter("Corner4") = 1 MultiValue.UpdateAfterChange = True End If
0 Likes
483 Views
3 Replies
Replies (3)
Message 2 of 4

A.Acheson
Mentor
Mentor

Welcome to the forum. Can you show a screenshot of the multi value parameter style or the whole dialogue box? If possible please provide the .ipt file as well. Are you running this rule as internal/external? 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 4

WCrihfield
Mentor
Mentor

I assume that the unquoted word "Style" in your rule is representing a 'local' (within the same document as the rule) parameter.  If not then you may have to change how it is being used.

Here is a slightly alternative code, where I've added most update type lines of code in their proper places.

'Update the current document when this rule finishes running.
iLogicVb.UpdateWhenDone = True
'The model will be updated after every Parameter change within the current rule.
Parameter.UpdateAfterChange = True
'The model will be updated after every MultiValue Parameter is changed within the current rule.
MultiValue.UpdateAfterChange = True

If Style = "HALF LAP" Then
	Parameter("Corner1") = 0.5
	Parameter("Corner2") = 0.5 
	Parameter("Corner3") = 0.5 
	Parameter("Corner4") = 0.5
ElseIf Style = "FULL LAP" Then
	Parameter("Corner1") = 0.2
	Parameter("Corner2") = 0.2 
	Parameter("Corner3") = 0.2
	Parameter("Corner4") = 0.2
ElseIf Style = "CORNER TO CORNER" Then
	Parameter("Corner1") = 1
	Parameter("Corner2") = 1 
	Parameter("Corner3") = 1 
	Parameter("Corner4") = 1
End If

'Output Parameters values from this rule to the Model. (Use this before Document Update)
RuleParametersOutput()
'Immediately update the current document.
iLogicVb.DocumentUpdate()

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 4

Curtis_Waguespack
Consultant
Consultant

 Hi @smanionDV2GJ ,

 

Attached is an Inventor 2019 file using this code that works as expected. Maybe you can examine this file and maybe it will become clear why it works in it and not in your file.

 

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

If Style = "HALF LAP" Then
	oValue = 0.5
ElseIf Style = "FULL LAP" Then
	oValue = 0.2
ElseIf Style = "CORNER TO CORNER" Then
	oValue = 1
End If

For i = 1 To 4
	Parameter("Corner" & i) = oValue
Next

 

 

 

 

EESignature

0 Likes