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

Sorry I've forgot the following option

 

Sub IlogicRun()
    Ilogic ("messaggio.txt") ' file rule name
End Sub
Sub Ilogic(rule As String)
    Dim InventorApplication As Inventor.Application
    Set InventorApplication = GetObject(, "Inventor.Application")
    Dim iLogicAuto As Object
    Dim oDoc As Inventor.Document
    Set oDoc = InventorApplication.ActiveDocument
    If oDoc Is Nothing Then
        MsgBox ("Missing Inventor Document")
    Exit Sub
    End If
    Set iLogicAuto = GetiLogicAddin(InventorApplication)
    If (iLogicAuto Is Nothing) Then Exit Sub
    exe = iLogicAuto.Automation.RunExternalRule(oDoc, rule)
End Sub
        
Private Function GetiLogicAddin(ByRef InvApp As Inventor.Application) As Inventor.ApplicationAddIn
    Dim addIn As Inventor.ApplicationAddIn
        Set addIn = InvApp.ApplicationAddIns.ItemById("{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}")
        addIn.Activate
        Set GetiLogicAddin = addIn
End Function

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------