Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where can I find the ControlDefinitions Cmd list in Red String?

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Stakin
928 Views, 1 Reply

Where can I find the ControlDefinitions Cmd list in Red String?

1 REPLY 1
Message 2 of 2
jdkriek
in reply to: Stakin

Here's VBA from Brian Ekins - that will loop through all the Definitions and write to .txt file.

 

Sub PrintCommandNames() 
    ' Get the CommandManager object. 
    Dim oCommandMgr As CommandManager 
    Set oCommandMgr = ThisApplication.CommandManager 
    
    ' Get the collection of control definitions. 
    Dim oControlDefs As ControlDefinitions 
    Set oControlDefs = oCommandMgr.ControlDefinitions 

    ' Open the file and print out a header line. 
    Dim oControlDef As ControlDefinition 
    Open "C:\temp\CommandNames.txt" For Output As #1 
    Print #1, Tab(10); "Command Name"; Tab(75); _ 
              "Description"; vbNewLine 

    ' Iterate through the controls and write out the name. 
    For Each oControlDef In oControlDefs 
        Print #1, oControlDef.InternalName; Tab(55); _ 
                  oControlDef.DescriptionText 
    Next 

    ' Close the file. 
    Close #1 
End Sub

My iLogic isn't as elegantly formatted in the .txt file, but it works for me

 

Dim sPath As String = "C:\temp\CommandNames.txt" 
Dim oCommandMgr As CommandManager = ThisApplication.CommandManager 
Dim oControlDefs As ControlDefinitions = oCommandMgr.ControlDefinitions 
Dim oControlDef As ControlDefinition 
	If System.IO.File.Exists(sPath) = True Then 
		Dim objWriter As New System.IO.StreamWriter(sPath)
			For Each oControlDef In oControlDefs 
		objWriter.WriteLine(oControlDef.InternalName & " | | " & oControlDef.DescriptionText)
			Next
		objWriter.Close()
		MsgBox("List Written to File")
	Else
		MsgBox("File Does Not Exist")
	End If
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report