Here is a simple test to help you learn about them.
Create two external iLogic rules. First rule is named "NameValueMap 1". Second Rule is named "NameValueMap 2".
Copy & paste the following code into the rule named "NameValueMap 1"
'Create a NameValueMap
Dim oMap As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
'Add a Name / Value pair into it.
oMap.Add("TestName", "TestValue")
'Run your second rule here.
iLogicVb.RunExternalRule("NameValueMap 2", oMap)
'This is where you get the other Value back from the second rule.
MsgBox("First Rule - Value returned from second rule = " & oMap.Value("Return"))
'Now copy the following contents into the rule named "NameValueMap 2".
'Retrieve NameValue Pair from calling rule
'Arguments is a NameValueMap
Dim oRecivedValue As String = RuleArguments.Arguments.Value("TestName")
'This next line is just prooving that this rule recieved what you sent to it.
'You can delete it when you've learned the trick.
MsgBox("Second Rule - Recieved Pair Value = " & oRecivedValue)
'Do something with the oRecieved Value
'Now establish the value you want to send back to the Calling Rule.
Dim oValueToSendBack As String = "It Worked!"
'Return a new Value to the Calling Rule
RuleArguments.Arguments.Value("Return") = oValueToSendBack
I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.
Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.
- Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
- MessageBox, InputBox, and InputListBox Size & Format Options Click Here
- Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
- Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
- Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
- Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
- SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
- Create DocumentSubTypeEnum Click Here
Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield

(Not an Autodesk Employee)