MultiValue

MultiValue

martinhoos
Advocate Advocate
550 Views
3 Replies
Message 1 of 4

MultiValue

martinhoos
Advocate
Advocate

Hello,

i try to create MultiValue Lists that depend on other MultiValue Lists. Long Story short, i have a form where i can change material "Kupfer" and "Aluminium". If i choose "Kupfer" the MultiValue of "rm_rohr_typ" should be "1_XXX, 2_XXX, 3_XXX and 4_XXX". If i choose "Aluminium the MultiValue of "rm_rohr_typ" shouldt be "1_YYY, 2_YYY and 3_YYY".

The rule should check, if the user parameter exists, if yes only the MultiValue should change. If not, the user parameter  should create with the MultiValue.

 

If this works, i can complete the rule with additional IF THEN - For example: IF Kupfer and 1_XXX use blue, IF Kupfer and 2_YYY use green....

 

Thanks in advance.

 

Regards Martin

 

 

iLogicVb.UpdateWhenDone = True
oMyParameter = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters

Try
	'Change value of param
		Parameter("rm_rohr_material") = "Kupfer"
	Catch
	'Create Param as it doesn't exist
	oParameter=oMyParameter.AddByValue("rm_rohr_material", "Kupfer", UnitsTypeEnum.kTextUnits)
	Parameter.Param("rm_rohr_material").Comment = "Rohmaterial Kupfer"
	MultiValue.SetList("rm_rohr_material", "Kupfer", "Aluminium")
	End Try 
	MultiValue.SetList("rm_rohr_material", "Kupfer", "Aluminium")

If rm_rohr_material = "Kupfer" Then
Try
	'Change value of param
	Parameter("rm_rohr_typ") = "1_XXX"
	Catch
	'Create Param as it doesn't exist
	oParameter=oMyParameter.AddByValue("rm_rohr_typ", "1_XXX", UnitsTypeEnum.kTextUnits)
	Parameter.Param("rm_rohr_typ").Comment = "Rohrleitungstyp"
	MultiValue.SetList("rm_rohr_typ", "1_XXX", "2_XXX", "3_XXX", "4_XXX")
	End Try 
	MultiValue.SetList("rm_rohr_typ", "1_XXX", "2_XXX", "3_XXX", "4_XXX")

Else If rm_rohr_material = "Aluminium" Then
Try
	'Change value of param
	Parameter("rm_rohr_typ") = "1_YYY"
	Catch
	'Create Param as it doesn't exist
	oParameter=oMyParameter.AddByValue("rm_rohr_typ", "1_YYY", UnitsTypeEnum.kTextUnits)
	Parameter.Param("rm_rohr_typ").Comment = "Rohrleitungstyp"
	MultiValue.SetList("rm_rohr_typ", "1_YYY", "2_YYY", "3_YYY")
	End Try 
	MultiValue.SetList("rm_rohr_typ", "1_YYY", "2_YYY", "3_YYY")
End If	


 

 

0 Likes
Accepted solutions (1)
551 Views
3 Replies
Replies (3)
Message 2 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@martinhoos,

 

Try the below 2 iLogic code to create multivalue list based on parameter.

 

Rule0: This rule is to create 2 MultiValue list

 

Try 
 Parameter("rm_rohr_material") = "Kupfer"
Catch 
 oMyParameter = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters
 'Create Param as it doesn't exist
 oParameter=oMyParameter.AddByValue("rm_rohr_material", "Kupfer", UnitsTypeEnum.kTextUnits)
 Parameter.Param("rm_rohr_material").Comment = "Rohmaterial Kupfer"
 MultiValue.SetList("rm_rohr_material", "Kupfer", "Aluminium") 
 Parameter("rm_rohr_material") = "Kupfer"
 'Create Param as it doesn't exist
 oParameter=oMyParameter.AddByValue("rm_rohr_typ", "1_XXX", UnitsTypeEnum.kTextUnits)
 Parameter.Param("rm_rohr_typ").Comment = "Rohrleitungstyp"
 MultiValue.SetList("rm_rohr_typ", "1_XXX", "2_XXX", "3_XXX", "4_XXX")
 Parameter("rm_rohr_typ") = "1_XXX" 
End Try 

Rule1: This rule is to update MultiValue list based on user parameter selection.

 

If rm_rohr_material = "Kupfer" Then 
 
  MultiValue.SetList("rm_rohr_typ", "1_XXX", "2_XXX", "3_XXX", "4_XXX")
  Parameter("rm_rohr_typ") = "1_XXX"  
 
Else If rm_rohr_material = "Aluminium" Then 
 
  MultiValue.SetList("rm_rohr_typ", "1_YYY", "2_YYY", "3_YYY")
  Parameter("rm_rohr_typ") = "1_YYY"
 
End If

A detailed procedure is prepared as shown below.

 

 

 

Please feel free to contact if there is any queries.

 

If solves problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,

 

 

 

 


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

 

 

 


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 4 of 4

martinhoos
Advocate
Advocate

Hello Chandra, thats it - thank you very much for your tip!

regards

Martin 

0 Likes