- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
(Not an Autodesk Employee)