Message 1 of 2
[iLogic] RunRule runs also suppressed rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I recently came up with this problem: RunRule runs also suppressed rules.
It's not a big deal because I just added iLogicRule.IsActive property to check this. But I struggle some hours looking for strange parameter behaviour of child occurrence in which rule is suppressed.
I don't know if it is a minor bug or an Idea to implement, anyway I wrote here to track this thing.
And here's some code lines to reproduce the problem:
main assembly:
SyntaxEditor Code Snippet
Dim doc = ThisDoc.Document For Each occ As ComponentOccurrence In doc.ComponentDefinition.Occurrences Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap() Dim rule As iLogicRule = iLogicVb.Automation.GetRule(occ.Definition.Document, "NestedRule") If rule IsNot Nothing Then If rule.IsActive Then map.Add("arg1", "Active") iLogicVb.RunRule(occ.Name, "NestedRule", map) Else map.Add("arg1", "Suppressed") iLogicVb.RunRule(occ.Name, "NestedRule", map) End If End If Next
Add NestedRule in child occurrence:
SyntaxEditor Code Snippet
arg1Value = RuleArguments("arg1") MsgBox(arg1Value)