Built-In AddIn API any?

Built-In AddIn API any?

Maxim-CADman77
Advisor Advisor
486 Views
3 Replies
Message 1 of 4

Built-In AddIn API any?

Maxim-CADman77
Advisor
Advisor

AFAIK Inventor AddIn can have its own API, right?

I'd like to know the way/method* to determine which of built-in Inventor AddIns do have their own API.

 

* I believe it can be doable by means of something like Object Browser in MS Visual Studio .. but don't know where to start from.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (2)
487 Views
3 Replies
Replies (3)
Message 2 of 4

lmc.engineering
Advocate
Advocate
Accepted solution

Hi @Maxim-CADman77 

As far as I understand you can test if the addin is exposing an API by checking if the Automation property in the ApplicationAddInServer class returns an object. If it does return an object then you know the addin is exposing something, but what that something is cannot be known without first knowing the public interface name.. and for that you'd either need the documentation or need to look inside the DLLs, both defeating the point of testing if the addin returns an automation object, as documentation would tell you yay or nay. I'd happily be corrected on this as it would be very useful to know these interfaces, but I think you'll be stuck with simply knowing if an addin is exposing something.. See below:

 

For Each addIn As Inventor.ApplicationAddIn In g_invApp.ApplicationAddIns
            Dim _addInInterface As Object
            Try
                Task.Run(Sub()
                             Try
                                 _addInInterface = addIn.Automation
                                 If _addInInterface IsNot Nothing Then
                                     Debug.Print("Addin: " & addIn.DisplayName & " ID: " & addIn.ClientId & ": ADDIN IS EXPOSED")
                                 End If
                             Catch ex As Exception
                                 Debug.Print("Addin: " & addIn.DisplayName & " ID: " & addIn.ClientId & ": NO AUTOMATION AVAILABLE")
                             End Try
                         End Sub)
            Catch ex As Exception
                Debug.WriteLine("Error running task: " & ex.Message)
            End Try
        Next

 

Message 3 of 4

WCrihfield
Mentor
Mentor

This may just be pointing out the seemingly obvious, but we do know that iLogic itself is an Inventor.ApplicationAddIn, and we also know that it has its own API, which is different from the Inventor API.  We can see the help documentation for both the Inventor API, and the iLogic API in the online help documentation.  I believe that settles the initial question of whether an add-in can have its own API or not.

WCrihfield_1-1696851819864.png

In the past, when folks were first getting started with automating Inventor by code, it could take quite a while to figure out where that line is between the two.  The Inventor API is much more 'traditional', requiring objects as input to most of its methods, while the iLogic API generally attempts to be more beginner friendly, requiring more String type inputs that represent the names of objects (even if those objects do not typically have names), then extra code runs in the background to obtain those named objects for the user, instead of the user having to supply the actual objects themselves.  When accessing iLogic functionality from outside of iLogic, we can usually access its Automation object, as mentioned by @lmc.engineering.  There have been examples of that functionality for many, many years where folks create VBA macros, just to get the button they could put in a ribbon, then the VBA macro it runs simply runs an iLogic rule.  I used to do that a lot myself, before upgrading to the 2024 version software.  I pretty much always preferred iLogic & vb.net coding over VBA coding, because it seemed newer, more efficient, and more dynamic, even though iLogic has such a basic user interface.  But accessing the Automation object generally just leaves you with a generic Object, so more exploration is generally required at that point to figure out what is available below it.  I have looked into the methods and properties of a few of the add-ins before, looking for more intuitive ways to do certain things through them using the Reflection functionality (Link1, Link2, Link3).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4

Maxim-CADman77
Advisor
Advisor
Accepted solution

@lmc.engineering 
According to the technique you've shared only 12 Add-Ins built-in can have APIs:

  1. Anark 3D PDF Publishing
  2. BIM Content
  3. Content Center
  4. Drag & Drop Interoperability
  5. iLogic
  6. Inventor Studio
  7. Presentations
  8. Routed Systems: Cable & Harness
  9. Routed Systems: Tube & Pipe
  10. Simulation: Dynamic Simulation
  11. Simulation: Frame Analysis
  12. Simulation: Stress Analysis

PS:
Also 'Inventor Vault' (standard but not built-in) does have sign of existing API

 

Please vote for Inventor-Idea Text Search within Option Names

0 Likes