Is it possible to add an ilogic Rule to the Marking Menu (Marking Menu shown below)?
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
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
(Not an Autodesk Employee)
The macro/vba/ilogic is becoming a thing for me for sure!
how would i call an ilogic rule from a macro?
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
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.