Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Owner2229
in reply to: MechMachineMan

Something like this? It's the basic snipset to run external rule, you can remove the lines you don't need.

 

Public Sub RunRule()
    RuniLogic ("C:\Path\MyRule.iLogicVb")
End Sub

Public Sub RuniLogic(ByVal RuleName As String)
    Dim iLogicAuto As Object
    Dim oDoc As Document
    Set oDoc = ThisApplication.ActiveDocument
    If oDoc Is Nothing Then
        MsgBox "Missing Inventor Document"
        Exit Sub
    End If
    Set iLogicAuto = GetiLogicAddin(ThisApplication)
    If (iLogicAuto Is Nothing) Then Exit Sub
    iLogicAuto.RunExternalRule oDoc, 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

 

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