External rules not running

External rules not running

blandb
Mentor Mentor
249 Views
4 Replies
Message 1 of 5

External rules not running

blandb
Mentor
Mentor

I have a message box with yes/no. If "yes" is chosen to run 1 rule, and if no, then run another. But they don't work. I have placed message boxes in to see if the code is recognizing it and it does. But it will not fire the external rules. I can manually click on the external rule and it will run, but not if I have called it to do so??

oInput = MessageBox.Show("Select another set?", "ilogic", MessageBoxButtons.YesNo)

If oInput = vbYes Then
	MessageBox.Show("I HIT YES", "Title")' this will show up
	iLogicVb.RunExternalRule("EXTERNAL RULE 1")' will not run if yes is selected
	Else
	MessageBox.Show("NO WAS SELECTED", "Title")' this will show up
	iLogicVb.RunExternalRule("EXTERNAL RULE 2")' will not run if no is selected
End If

Any ideas?

Autodesk Certified Professional
0 Likes
250 Views
4 Replies
Replies (4)
Message 2 of 5

A.Acheson
Mentor
Mentor

Hi @blandb 

It is working as expected. Have you placed in a message box in each rule? This will confirm you have started the rule. It is likely your target document is not correct. Maybe try a line like this. Maybe also check the spelling of each rule. 

MessageBox.Show(ThisApplication.ActiveDocument.DisplayName, "Title")

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 5

blandb
Mentor
Mentor

The 2 rules I am firing either have a dialog box that opens or I am prompted to select something. Niether is happening which clues me in that it is not firing. I have placed in a message box and have double checked my rule name syntax, but nothing.

Autodesk Certified Professional
0 Likes
Message 4 of 5

A.Acheson
Mentor
Mentor

It sounds like a deeper problem in the ilogic editor. Perhaps some setting stop the external rule firing. Restart inventor perhaps. Out of ideas after that. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 5

d_eckel
Contributor
Contributor

Hi @blandb 

Maybe check the iLogic Protocoll and see if the external rules are triggered and completed.

0 Likes