enable/disable Invnetor 2022 Addon via VBA /Inventor Zusatzmodule per VBA aktivieren/deaktivieren

enable/disable Invnetor 2022 Addon via VBA /Inventor Zusatzmodule per VBA aktivieren/deaktivieren

david.schulzeMYVKG
Explorer Explorer
384 Views
2 Replies
Message 1 of 3

enable/disable Invnetor 2022 Addon via VBA /Inventor Zusatzmodule per VBA aktivieren/deaktivieren

david.schulzeMYVKG
Explorer
Explorer

Hallo,

 

ich bin auf der Suche nach einem Befehl mit dem ich ein bestimmtes Inventor (2022) Zusatzmodul per VBA aktivieren und deaktivieren kann.

 

Hat das schon einmal wer gemacht?

 

Danke für eure Mithilfe.

 

--

"Hello,

I am looking for a command to enable and disable a specific Inventor (2022) add-on module via VBA.

 

Has anyone done this before?

 

Thanks for your help"

@david.schulzeMYVKG  Translated by @hazem.adel 

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

WCrihfield
Mentor
Mentor

Hi @david.schulzeMYVKG.  It looks to me like you are looking for this methods:  ApplicationAddIn.Activate &   ApplicationAddIn.Deactivate.  If you know the 'Client ID' of the ApplicationAddIn, you can get it through ThisApplication.ApplicationAddIns.ItemById().  Or if you know the DisplayName of the add in, you can loop through the ApplicationAddIns and compare the known name to each DisplayName to find it. 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Here is some VBA code to get you started.  Just replace the text "AddInDisplayName" with the name DisplayName of the AddIn you want to work with.  Or, if you know the Class ID of the AddIn, you can skip or delete the loop, and just use the other means (commented out) of identifying the AddIn you want to work with.

Sub ToggleAddIn()
    Dim oAddIns As ApplicationAddIns
    Set oAddIns = ThisApplication.ApplicationAddIns
    Dim oAddIn As ApplicationAddIn
    For Each oAddIn In oAddIns
        If oAddIn.DisplayName = "AddInDisplayName" Then
            If oAddIn.Activated Then
                oAddIn.Deactivate
            Else
                oAddIn.Activate
            End If
        End If
    Next
    'Dim oMyAddIn As ApplicationAddIn
    'Set oMyAddIn = oAddIns.ItemById("{.......}")
    'oMyAddIn.Activate
End Sub

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes