Well, no. You can't share variables between rules. At least not in iLogic.
Here are some other options you could use:
1) Use VBA or an AddIn
2) Store your "variables" somewhere in the open Inventor file (Parameter, iProperty, Attribute)
3) Re-work your code to work with Sub-Functions:
Sub Main()
'This Sub will execute when your rule starts
A = 10
ShowValue(A)
A = GetNewValue(A, 10)
ShowValue(A)
End Sub
Private A As Integer
Private Sub ShowValue(B As Integer)
MsgBox(CStr(B))
End Sub
Private Function GetNewValue(B As Integer, Addition As Integer) As Integer
Return (B + Addition)
End Funtion
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods