Sub RuniLogicRule()
RuniLogic ("Path to extrenal rule.txt")
End Sub
Public Sub RuniLogic(ByVal RuleName As String)
Dim iLogicAuto As Object
Dim invDoc As DrawingDocument
Set invDoc = ThisApplication.ActiveDocument
Set iLogicAuto = GetiLogicAddin(ThisApplication)
If (iLogicAuto Is Nothing) Then Exit Sub
iLogicAuto.RunExternalRule invDoc, RuleName
End Sub
Public Function GetiLogicAddin(oApplication As Inventor.Application) As Object
Dim addIn As ApplicationAddIn
On Error GoTo NotFound
Set addIn = oApplication.ApplicationAddIns.ItemById("{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}")
If (addIn Is Nothing) Then Exit Function
addIn.Activate
Set GetiLogicAddin = addIn.Automation
Exit Function
NotFound:
End Function
This is the code to call an extrenal ilogic rule from VBA.
Create a form and for each of the buttons when clicked call the sub which runs the relevant external ilogic rule, which can be saved in a txt document.