Print list of all Inventor Commands
Description
This sample prints the internal names and descriptions of all commands (aka ControlDefinitions) in Inventor.Code Samples
The sample prints the names and descriptions to a text file (CommandNames.txt) created in C:\Temp directory. You should either have the C:\Temp directory or change the path in the sample.
Sub PrintCommandNames()
Dim oControlDefs As ControlDefinitions
Set oControlDefs = ThisApplication.CommandManager.ControlDefinitions
Dim oControlDef As ControlDefinition
Open "C:\temp\CommandNames.txt" For Output As #1
Print #1, "Command Name"; Space(49); "Description"; vbNewLine
For Each oControlDef In oControlDefs
If Len(Trim(oControlDef.InternalName)) < 60 Then
sName = Trim(oControlDef.InternalName) & Space(60 - Len(Trim(oControlDef.InternalName)))
Else
sName = Trim(oControlDef.InternalName)
End If
Print #1, sName; " "; Replace(Trim(oControlDef.DescriptionText), vbCr, "")
Next
Close #1
End Sub
