Message 1 of 16
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to set a list to a parameter, using the API ( not iLogic functions) and I'm seeing an odd result. Maybe I'm missing something obvious?
Can someone put "fresh eyes" on this and let me know what I'm missing?
Thanks!
You can see the result by running this code from an iLogic rule in any part file.
After running the rule, the parameter does not have a list
But if I return to the rule in the iLogic editor, and hover over the parameter I see the list
Capture current state also pulls the list, but I can't use the iLogic Multivalue function in my case, because in the end I intend this to be in an add-in.
Dim list As New ArrayList list.Add("11111") list.Add("22222") list.Add("33333") 'list.Add("44444") Dim InvDocument As Document = ThisDoc.Document Dim oListParam As Inventor.Parameter Try oListParam = InvDocument.ComponentDefinition.Parameters.UserParameters.Item("Test") Catch oListParam = InvDocument.ComponentDefinition.Parameters.UserParameters.AddByValue("Test", "", UnitsTypeEnum.kTextUnits) End Try 'set array list to string array Dim ListArray As String() For i = 0 To list.Count - 1 ReDim Preserve ListArray(i) ListArray(i) = list.Item(i) Next MsgBox(UBound(ListArray)) 'set list to parameter oListParam.ExpressionList.SetExpressionList(ListArray)
Solved! Go to Solution.