I've caught glimpses of how to do this (For instance, this plugin (Inventor LinkParameters) http://labs.autodesk.com/utilities/ADN_plugins/) , but honestly feel stumped when trying to actually find information on any documentation of how to get from point A to point B. I can't seem to find anything about ilogic automation / rule creation / ilogic in general, in the object browser at all.
I know code like this exists
Option Explicit Sub RuniLogicRule() Dim iLogicAuto As Object Set iLogicAuto = GetiLogicAddin(ThisApplication) If (iLogicAuto Is Nothing) Then Exit Sub Dim doc As Document Set doc = ThisApplication.ActiveDocument Dim ruleName As String ruleName = "Rule0" Dim rule As Object Set rule = iLogicAuto.GetRule(doc, "Rule0") If (rule Is Nothing) Then Call MsgBox("No rule named " & ruleName & " was found in the document.") Exit Sub End If Dim i As Integer i = iLogicAuto.RunRuleDirect(rule) End Sub Function GetiLogicAddin(oApplication As Inventor.Application) As Object Dim addIns As ApplicationAddIns Set addIns = oApplication.ApplicationAddIns 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
(and even fixed the error it gave me due to the original code leaving something out) , but have no idea where any info on the GetRule method is.
If anyone could help to point me in the correct direction for documentation or could provide an example even, I would be most grateful, as I certainly failing to see a major piece of the puzzle.
There is some documentation available. If you open the LinkParameters solution in Visual Studio, you can find it on the Object Browser under Autodesk.iLogic.Interfaces. Look at the IiLogicAutomation interface. This has an AddRule function.
This documentation is found in an XML file: Autodesk.iLogic.Interfaces.xml. On Inventor 2011, this file is found in
C:\Program Files\Autodesk\Inventor 2011\Bin\iLogicBin
On 2012, it is found in
C:\Program Files\Autodesk\Inventor 2012\Bin
We should be able to add more documentation and produce a .chm file in a future version.
Is there a way to add a reference to this file in the VBA editor (that comes with Inventor)? Any time that I try to add it in the object browser it gives me the error of : Can’t add a reference to the specified file.
I have Visual Studios at home, but not here at work, which is why I am curious about adding it to the VBA editor if possible.
Thank you!
You can't add it in VBA because it only exposes .NET interfaces, and not COM.
You can download a free version of Visual Studio (Visual Basic Express) at
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express
Hi @Walliguy - do you mean Autodesk.iLogic.Interfaces.xml?
For recent releases of Inventor, all the information in there is now available online. Here's the 2024 version.
Can't find what you're looking for? Ask the community or share your knowledge.