Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Using Namemap argument to pass an array to another rule

cencinaNB2ET
Advocate

Using Namemap argument to pass an array to another rule

cencinaNB2ET
Advocate
Advocate

Hi,

 

I know how to pass single variables but how would you pass on an array or an array-list to another rule using the createvaluemap function?

Any ideas would help me.

 

 

 

Thanks in Advance

0 Likes
Reply
316 Views
1 Reply
Reply (1)

cencinaNB2ET
Advocate
Advocate

Just figured it out....

 

You have to loop the namevalue map process as you would with any unknown array length

i converted the array list to a string array because it seems to work better.

Here is the Code

 

Rule 1

Dim NamesList As New ArrayList

NamesList.Add("Part_N")

NamesList.Add("Types")

NamesList.Add("Diam")

 

For k = 0 To NamesList.Count - 1

MessageBox.Show( NamesList(k) , "Works")

Next k

 

Dim Heading_Names As String() = CType(NamesList.ToArray(GetType(String)), String())

 

For g = 0 To Heading_Names.Length -1

MessageBox.Show( Heading_Names(g), "")

Next g

 

 

For z = 0 To Heading_Names.Length -1

Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()

'map.Add("Arg1", "Arg1Value")

map.Add("Arg1", Heading_Names(z))

iLogicVb.RunRule("Rule7", map)

Next z

 

 

Rule 2

Arrays = RuleArguments("Arg1") If RuleArguments.Exists("Arg1")ThenMessageBox.Show("All My Arrays = " & Arrays , "Msg Box Test")

End If

0 Likes