iLogic rules gets triggered by another rule

iLogic rules gets triggered by another rule

Daan_M
Collaborator Collaborator
761 Views
3 Replies
Message 1 of 4

iLogic rules gets triggered by another rule

Daan_M
Collaborator
Collaborator

Hi,

 

I've got two iLogic rules, but one of them seems to trigger the other somehow.

 

Rule 1 = Assemble

Rule 2 = Check Excel

 

When i check the Excel, it somehow runs Rule 1 after it's finished, but i don't understand why.

 

Rule 2 code:

 

 

Imports System.Text.RegularExpressions
Imports Microsoft.VisualBasic.FileIO
Sub Main()

Dim oDoc As Inventor.Document = ThisDoc.Document
Dim oSourceFile As String = "X:\Path\Test.xlsx"

Dim CellCounter As Integer = 1
Dim FileTotal As Integer = 4

Do While CellCounter < FileTotal

Parameter("Type") 				= GoExcel.CellValue(oSourceFile, "Blad1", "A" & CellCounter).ToString
Parameter("Vermogen") 			= GoExcel.CellValue(oSourceFile, "Blad1", "B" & CellCounter).ToString
Parameter("Motorflens") 		= GoExcel.CellValue(oSourceFile, "Blad1", "C" & CellCounter).ToString
Parameter("Rem")				= GoExcel.CellValue(oSourceFile, "Blad1", "D" & CellCounter).ToString
Parameter("Handrem")			= GoExcel.CellValue(oSourceFile, "Blad1", "E" & CellCounter).ToString
Parameter("Handrem_Positie") 	= GoExcel.CellValue(oSourceFile, "Blad1", "F" & CellCounter).ToString
Parameter("Wartelpositie")		= GoExcel.CellValue(oSourceFile, "Blad1", "G" & CellCounter).ToString
Parameter("Bestandsnaam")		= GoExcel.CellValue(oSourceFile, "Blad1", "H" & CellCounter).ToString

Parameter("Opslaan") 			= "Ja"

CellCounter = CellCounter + 1

Loop

End Sub

 

 

 

 

 

Why is this happening? i disabled all event triggers

 

Additional information of which i'm not sure wether it's important; The paramater are present in rule 1 as well and get used for the assembly.

0 Likes
Accepted solutions (1)
762 Views
3 Replies
Replies (3)
Message 2 of 4

Andrii_Humeniuk
Advisor
Advisor

Hi @Daan_M . You change user parameters using the Parameter() function, if your Rule 1 = Assemble is among "Event Triggers" "Any User Parameter Change" then it will automatically fire. 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 4

Daan_M
Collaborator
Collaborator
Accepted solution

Found the problem;

 

One of the user paramaters in rule 1 was stated as:

Bestandsnaam

instead of:

Parameter("Bestandsnaam")

When rule 2 changes this paramater based on the Excel, the parameterchange triggers rule 1.

Which i still find a bit strange, since i have the Event trigger for 'Any User Parameter Change' disabled;

 

Daan_M_0-1693474112989.png

 

Either way this solved the problem, for future users looking for the answer

 

0 Likes
Message 4 of 4

JMGunnar
Collaborator
Collaborator

"Blue"  Parameter always trigger  run rule automatically 

 

 

this options in rule 

 

Best regards Johan

JMGunnar_0-1693480151723.png