Check if a given addin is loaded

Check if a given addin is loaded

Anders_Olsen
Contributor Contributor
442 Views
2 Replies
Message 1 of 3

Check if a given addin is loaded

Anders_Olsen
Contributor
Contributor

I'm looking for some way to check whether a given addin is loaded or not. I want to use this to determine whether to run my own alternative custom functions, in case the addin is not loaded (I'm using a third party addin, which I only load when I need its more complex functionality, because the addin is a drag on performance).

 

I would have thought I could do something like this:

Dim addIn As Inventor.ApplicationAddIn
addIns = inv_app.ApplicationAddIns

For Each addin In addIns
   MsgBox(addin.Name)
Next

In order to get some kind of identification. I know that  addins.ItemById("{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}") yields the iLogic addin for example.

 

But doing so is not an option, since "Expression (i.e. "addins") is of type 'ApplicationAddin', which is not a collection type".

 

Does anyone know how to do this?

 

Thanks!

0 Likes
Accepted solutions (1)
443 Views
2 Replies
Replies (2)
Message 2 of 3

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @Anders_Olsen . If I understand correctly, you need to check the bool variable "Activated". Your code should look something like this:

Dim sName As String = "Frame Generator"
Dim oInvApp As Inventor.Application = ThisApplication

For i As Integer = 1 To oInvApp.ApplicationAddIns.Count	
	If Not oInvApp.ApplicationAddIns(i).DisplayName = sName Then Continue For
	If oInvApp.ApplicationAddIns(i).Activated Then
		MessageBox.Show("The user has activated the application!", sName)
	Else
		MessageBox.Show("The user has not activated the application!", sName)
	End If
Next i

In the example, the activity of the Frame Generator application is checked. 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 3 of 3

Anders_Olsen
Contributor
Contributor

Hi Andii,

 

Well, that was actually much simpler than I thought. Thanks, works like a charm! 

 

/Anders

0 Likes