Rule for dynamic multi value list

Rule for dynamic multi value list

SpokenEarth
Advocate Advocate
933 Views
8 Replies
Message 1 of 9

Rule for dynamic multi value list

SpokenEarth
Advocate
Advocate

Hello I have a problem and I would appreciate any help you can give. The first image shows a dynamic multi value list with TYPE and SIZE as a text parameter. I'm trying to figure out how to disable all the unwanted radio groups when I have chosen the one I want to use.
The second image shows what I'm trying to achieve.

Thank you

0 Likes
Accepted solutions (2)
934 Views
8 Replies
Replies (8)
Message 2 of 9

WCrihfield
Mentor
Mentor
Accepted solution

Have you read through this other post yet?  It is dealing with a very similar task, but using the radio groups instead of the drop-down lists.  It looks like your iLogic Form is a 'local' one, so it should be able to instantly react to parameter selections, as long as you have the iLogic rules set-up do handle the parameter value change events.  Which version of Inventor are you using (year)?  Are all the filter type changes happening OK for you when you make selections?  If so, then are you simply trying to change the layout, and not the functionality?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 9

SpokenEarth
Advocate
Advocate
'['SET TYPE MULTI TEXT

iLogicVb.UpdateWhenDone = True

  
'check For Parameter and create If Not found
Try
'get parameter value (just to see if it exists)
oTest = Parameter("TYPE") 
Catch
' Get the active document.  Assumes a part document is active.
Dim partDoc As PartDocument
partDoc = ThisApplication.ActiveDocument
' Get the UserParameters collection
Dim userParams As UserParameters
userParams = partDoc.ComponentDefinition.Parameters.UserParameters
	
'create the parameter
oParam = userParams.AddByValue("TYPE","DIN 32676 SERIES 1", UnitsTypeEnum.kTextUnits)
End Try

'Set the list
MultiValue.SetList("TYPE","DIN 32676 SERIES 1","DIN 32676 SERIES 2 STANDARD", 
"DIN 32676 SERIES 2 NON STANDARD", "DIN 32676 SERIES 3", "ISO 2037 SERIES 1", "ISO 2037 SERIES 2",
"ISO 1127 SERIES 1", "ISO 1127 VARIATIONS","DIN 11850","ASME BPE", "BS 4825-3", "BS SCHEDULE 5", "BS SCHEDULE 10", 
"BS SCHEDULE 40","MINI SERIES ULTRA BORE IMPERIAL","MINI SERIES ULTRA BORE METRIC","14 MPW TANK","SWG")

'set default value
Parameter("TYPE") = "DIN 32676 SERIES 1"
0 Likes
Message 4 of 9

SpokenEarth
Advocate
Advocate
'['DIN 32676 SERIES 1 SET LIST AND DEFAULT
If TYPE = "DIN 32676 SERIES 1" Then	
'SET LIST
MultiValue.SetList("SIZE","DN10","DN15","DN20","DN25","DN32","DN40","DN50")
'SET DEFAULT LIST
Parameter("SIZE") = "DN10"
End If

']

'['DIN 32676 SERIES 2 STANDARD SET LIST AND DEFAULT
If TYPE = "DIN 32676 SERIES 2 STANDARD" Then	
'SET LIST
MultiValue.SetList("SIZE","DN10","DN15","DN20","DN25","DN32","DN40","DN50","DN65","DN80","DN100","DN125","DN150","DN200")
'SET DEFAULT LIST
Parameter("SIZE") = "DN10"
End If

']
0 Likes
Message 5 of 9

SpokenEarth
Advocate
Advocate

Im running 2021, value change events it doesn't trigger

0 Likes
Message 6 of 9

WCrihfield
Mentor
Mentor

OK. I'm seeing a total of two parameters involved in the two rules you posted above. The same two that appear to be used in the Form in the first image you posted. But in the second image of a Form you posted, it is showing what looks like 4 drop-down lists and one radio group, which it seems to me would be representing 5 different multi-value parameters. After reviewing your two rules, I assume at least the one labeled "Din 32676 Series 1 Set List And Default" is a local rule, because it seems to be accessing the paramater named "Type" directly by name without quotes. That one should automatically be fired to run whenever the value of Type changes. The other rule won't automatically fire for any reason, unless you have added it to the Event Triggers dialog under one of its listed events, because it doesn't contain any direct (unquoted) parameter names. Also, even though Type has a long list of possible values, your second rule is only checking for a couple of its possible values. So even if you did run that second rule, it would only do something if Type was currently set to one of those two values. Then Type is one of those two values, it looks like it is changing the list of values for the parameter named "SIZE", then setting its value. So if you were using the form in that first image, and these were the only two rules involved, I would think that when you changed the value of Type in the Form, it would cause the second rule to run, then if the new value of Type was one of those two values, it would update the list of available values under SIZE. Are the names of both parameters in the rules correct and is capitalization correct?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 7 of 9

SpokenEarth
Advocate
Advocate

I check all parameters in the rules and their names are matching.

When  I'm fire from the radio group nothing happens.

I need to rethink it

0 Likes
Message 8 of 9

WCrihfield
Mentor
Mentor
Accepted solution

I created a sample part file to test with, copied your two rules into two new local rule in that document, then ran the one rule to create the TYPE parameter, and its values.  Then I manually created the SIZE parameter, then ran the second rule to give it the multiple values.  I then created a new local iLogic Form, similar to what you had in your first image.  On that finished Form, when I switched between those first to values of TYPE (which are being checked for by the second rule), it changed the available values within the SIZE group.  That seems to me like the way it should be, unless I'm just not understanding.  I switched between showing the SIZE group as a radio group, and a combo box, bit it continued to function properly both ways.  When SIZE was displayed as a drop-down list (combo box) I would just have to click the drop-down to see what values were available, but it still worked.

 

You can't really change the design or layout of an iLogic Form in any way from an iLogic rule.  All you can do with an iLogic Form from an iLogic rule is show the Form, and get feedback (FormReturnValue) which indicates how the form was closed.  And if the form was closed using a rule button, it can return which rule it was associated with.  If you need to change how the form looks or functions, you will need to do that within the iLogic Form Editor dialog.

 

I'm using Inventor 2021.2.2, which it seems is a little newer than yours, so maybe I am unable to reproduce the same errors or lack of functionality as you.  I'm not sure.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 9 of 9

SpokenEarth
Advocate
Advocate

Thanks you for your feedback and your help.

 

0 Likes