Updating Multi-Value parameters while running an iLogic rule

Updating Multi-Value parameters while running an iLogic rule

sergio_duran
Advocate Advocate
2,351 Views
2 Replies
Message 1 of 3

Updating Multi-Value parameters while running an iLogic rule

sergio_duran
Advocate
Advocate

Hi everyone,

 

Is there any way to update a multi-value parameter list that is changed by another multi-value parameter list (in the same rule) while the rule is running? I'd like to get both lists updated once the rule has finished. Let me give you an example to explain my question better.

 

SyntaxEditor Code Snippet

MultiValue.SetValueOptions(True, DefaultIndex := 0)

If TEST = True Then
MultiValue.SetList("ABC", 10, 20, 30)
   If ABC = 30 Then 
       MultiValue.SetList("XYZ", 1, 2, 3)
   Else
       MultiValue.SetList("XYZ", 7, 8, 9)
   End If
Else 'TEST = No
MultiValue.SetList("ABC", 40, 50, 60)
   If ABC = 40 Then 
       MultiValue.SetList("XYZ", 11, 12, 13)
   Else
       MultiValue.SetList("XYZ", 90, 80, 70)
   End If
End If

 

When I changed the "TEST" value, ABC will be updated the first time the rule runs but XYZ isn't updated it. I need to run the rule once again to update XYZ since it will see the new list of values of ABC. Is there any way to update both multi-value parameters only running the rule once (not twice)?

 

Thanks!

0 Likes
Accepted solutions (2)
2,352 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor
Accepted solution

Hi, Autodesk has some great explanations regarding the fix for this already online in the resources.

 

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2015...

 

 

'MultiValue.UpdateAfterChange =True will cause the model (document) to Update after the parameter is changed.
'This only takes effect when you change parameters using the Parameter function MultiValue.UpdateAfterChange = True
RuleParametersOutput()
InventorVb.DocumentUpdate()

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 3

sergio_duran
Advocate
Advocate
Accepted solution

Hi Justin,

 

Thanks for your quick reply and help! I overlooked the snippet 

MultiValue.UpdateAfterChange = True

I read and also noticed the importance of using the Parameter function instead of just the parameter name

"This only takes effect when you change parameters using the Parameter function"

 

Thanks! This solves my issue.

0 Likes