Bug: SilentOperation is most of the time not silient

Bug: SilentOperation is most of the time not silient

JelteDeJong
Mentor Mentor
383 Views
1 Reply
Message 1 of 2

Bug: SilentOperation is most of the time not silient

JelteDeJong
Mentor
Mentor

I can produce this problem with a part that has the following 3 ilogic rules.

rule: [main]

Dim iLogicAddin As ApplicationAddIn = Nothing
Dim iLogicAutomation
iLogicAddin = ThisApplication.ApplicationAddIns.ItemById("{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}")
iLogicAutomation = iLogicAddin.Automation

iLogicAutomation.RunRule(ThisDoc.Document, "with-Imports") ' msgbox 1: Does show
iLogicAutomation.RunRule(ThisDoc.Document, "none-Imports") ' msgbox 2: Does show

iLogicAutomation.SilentOperation = True
iLogicAutomation.RunRule(ThisDoc.Document, "with-Imports") ' msgbox 3: Does NOT show
iLogicAutomation.RunRule(ThisDoc.Document, "none-Imports") ' msgbox 4: Does show
iLogicAutomation.SilentOperation = False

iLogicAutomation.RunRule(ThisDoc.Document, "with-Imports") ' msgbox 5: Does show
iLogicAutomation.RunRule(ThisDoc.Document, "none-Imports") ' msgbox 6: Does show

Rule [with-Imports]

AddReference "GDH.Inventor.iLogic.Utilities.dll"
Imports GDH.Inv.iLogic.Utilities
Parameter("TEST") = Parameter("TEST") + 1
MsgBox("Test = " & Parameter("TEST"))

Rule [none-Imports]

' imports System.IO
Parameter("TEST") = Parameter("TEST") + 1
MsgBox("Test = " & Parameter("TEST"))

When i start the rule [main] i get 5  msgbox's. All msgbox's are shown when the iLogic-addin isn't in SilentOperation. But when the iLogic-addin is in SilentOperation then:

  • the rule with the imports-statement does not show a msgbox like i would expect form SilentOperation.
  • the rule without an import-statement does show a msgbox wich i would not expect.

it is a bit more complicated because the import statement should be to the namespace of a dll that is also loaded in the rule. for example the following import statement will not make the msgbox disapear.

imports System.IO

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

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

JelteDeJong
Mentor
Mentor

Here is also the part file that i use for testing for any one who wants to see it. But i can not attached the refrenced dll in the forum. (If anyone from autodesk wants it for testing purpose then plz send me a personal message) There for the rules will not work at all.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes