Hi,
I found that the productivity tools can be triggered thru their internal command ID like this:
Try
Dim cmd As ControlDefinition
cmd = ThisApplication.CommandManager.ControlDefinitions.Item("AssemblyBonusTools_AlphaSortComponentsCmd")
cmd.Execute()
Catch ex As Exception
MsgBox("Could not execute Alpha Sort Components command." & vbCrLf & ex.Message)
End Try
This is the equivalent of clicking the button in the UI.
For reference, I used this code to output all the command IDs:
Dim cm As CommandManager = ThisApplication.CommandManager
Dim filePath As String = "C:\Temp\Inventor_CommandIDs.txt"
Dim sw As New System.IO.StreamWriter(filePath, False)
For Each cd As ControlDefinition In cm.ControlDefinitions
sw.WriteLine(cd.InternalName & " | " & cd.DisplayName)
Next
sw.Close()
MsgBox("Done! File written to: " & filePath)
Best,
Fredrik