You could also try using a progress bar with a cancel button. I think this would work, but it would only be able to bail out from the parent rule, between each child rule. It wouldn't be able to stop operation within a child rule. You could try this and see how it works for you:
(If you run this as-is you can see a sample of how it works).
Sub Main()
'~~~~~Progresss bar setup~~~~~
Dim oTitle As String = "Progress Bar Title"
Dim OpsCount As Integer = 9 '<--- CHANGE TO YOUR # OF CHILD RULES BEING FIRED
Dim oDebugDelay As Integer = 1000 '<--- CHANGE TO ZERO WHEN TESTING WITH YOUR CHILD RULES
'~~~~~Initiate progress bar~~~~~
TotalOpsCount = OpsCount + 1 'Adds "Finishing..." operation
Dim oProgressBar As Inventor.ProgressBar = ThisApplication.CreateProgressBar(False,TotalOpsCount,oTitle,True)
AddHandler oProgressBar.OnCancel, AddressOf ProgressBarCancel
CurrentOp = -1
ContinueProcess = True
ProgressBarUpdate(oProgressBar,"Loading...",oDebugDelay)
'~~~~~~~~~~~~~Replace this:~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For i = 1 To TotalOpsCount - 1
If ContinueProcess = False Then Exit For
ProgressBarUpdate(oProgressBar,"Processing...",oDebugDelay)
Next
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~...with something like this:~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' iLogicVb.RunExternalRule("Rule1")
'
' If ContinueProcess = False Then Goto MyExit
' iLogicVb.RunExternalRule("Rule2")
'
' If ContinueProcess = False Then Goto MyExit
' iLogicVb.RunExternalRule("Rule3")
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MyExit:
ProgressBarUpdate(oProgressBar,"Finishing...",oDebugDelay)
oProgressBar.Close
End Sub
Private ContinueProcess As Boolean
Private CurrentOp As Integer
Private TotalOpsCount As Integer
Sub ProgressBarUpdate(oProgressBar As Inventor.ProgressBar, oMessage As String,Optional oDebugDelay As Integer = 0)
CurrentOp = CurrentOp + 1
Dim PercentComplete As Integer = CurrentOp/(TotalOpsCount) * 100
oProgressBar.Message = oMessage & vbCrLf & "Percent complete: " & PercentComplete & "%"
oProgressBar.UpdateProgress
System.Threading.Thread.Sleep(oDebugDelay)
End Sub 'Progress bar update
Sub ProgressBarCancel
MessageBox.Show("Process cancelled.","",MessageBoxButtons.OK,MessageBoxIcon.Exclamation)
ContinueProcess = False
End Sub