Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding iLogic Rule to Marking Menu

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
916 Views, 3 Replies

Adding iLogic Rule to Marking Menu

Is it possible to add an ilogic Rule to the Marking Menu (Marking Menu shown below)?

MarkingMenu.png

3 REPLIES 3
Message 2 of 4
WCrihfield
in reply to: Anonymous

Good question.  There doesn't appear to be a simple option available for that directly.  But, as a quickie work around, you could always create a very simple Macro that just runs your rule, then place that macro into that marking menu.

Perhaps you could suggest that idea in the Idea Station, if it isn't already there.  If there is already an idea like, you could up-vote it.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4
Anonymous
in reply to: WCrihfield

The macro/vba/ilogic is becoming a thing for me for sure! 
how would i call an ilogic rule from a macro?

Message 4 of 4
WCrihfield
in reply to: Anonymous

I'm sure there are numerous sources for similar code here on the forum, but here is a fairly simple one I was using for a while.  I had an external iLogic rule that would export an IDW (drawing document) to a PDF.  Then I used this VBA macro to run that rule, so that I could place the button for that macro onto my ribbon, for a 1-click run solution.

Here's the code:

First thing it does is get Inventor's iLogic Addin.  There is a more direct way to do this with fewer lines, by specifying it by its ID string, but I usually preffered to avoid doing it that way, because it uses a long, unreadable string of nonsense, versus just searching for it by its name.

It then defines the name of the external rule file.  Then identifies the document you want that external iLogic rule to affect (work on).  Then uses the iLogic Addin to run the rule.

Public Sub Export_IDW_to_PDF()
    Dim oAddIns As ApplicationAddIns
    Dim oAddIn As ApplicationAddIn
    Set oAddIns = ThisApplication.ApplicationAddIns
    For Each oAddIn In oAddIns
        If InStr(oAddIn.DisplayName, "iLogic") > 0 Then
            oAddIn.Activate
            Dim iLogicAuto As Object
            Set iLogicAuto = oAddIn.Automation
            Exit For
        End If
    Next
    'Debug.Print oAddIn.DisplayName
    Dim oXRuleName As String
    oXRuleName = "Export IDW to PDF"
    Dim oDoc As Document
    Set oDoc = ThisApplication.ActiveDocument
    If oDoc Is Nothing Then
        MsgBox "Missing Inventor Document"
    Exit Sub
    End If
    iLogicAuto.RunExternalRule oDoc, oXRuleName
End Sub

 

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report