[iLogic] RunRule runs also suppressed rules

[iLogic] RunRule runs also suppressed rules

CattabianiI
Collaborator Collaborator
370 Views
1 Reply
Message 1 of 2

[iLogic] RunRule runs also suppressed rules

CattabianiI
Collaborator
Collaborator

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)

 

0 Likes
371 Views
1 Reply
Reply (1)
Message 2 of 2

HermJan.Otterman
Advisor
Advisor

to be sure the code does not run, and I want to keep it, I always maken comments of it

(By addin an  '  in front of every line)

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes