multiparameters

multiparameters

mdejong
Participant Participant
201 Views
1 Reply
Message 1 of 2

multiparameters

mdejong
Participant
Participant
I have a small question about a part model and its multiparameter
1 multiparameter has 3 textvalues (2s,3s,5s)
other multiparameter has de values (90 , 60, 45)
how can i arrange in ilogic that if i set the other muliparameter on 90 that the first multiparameter only contains 2s and 3s?
0 Likes
Accepted solutions (1)
202 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

Give this iLogic rule a try.  You may have to change the names of the two parameters it is looking for, to match what you have, before it will work for you.

'Param1 is the unquoted name of the local parameter containing the (2s,3s,5s) text values
'Param2 is the unquoted name of the local parameter containg the (90,60,45) values

'get the 'local' part document
Dim oPDoc As PartDocument = ThisDoc.Document
'get the User Parameters collection within this part
Dim oUParams As UserParameters = oPDoc.ComponentDefinition.Parameters.UserParameters
'check the value/expression of Param2
If oUParams.Item("Param2").Expression = "90" Then
	'create a new Array of String with the values in it you want to give to the other parameter
	Dim oNewExpressionList() As String = {"2s", "3s" }
	'set this as the multi-value list of that parameter
	oUParams.Item("Param1").ExpressionList.SetExpressionList(oNewExpressionList)
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)