Can I know the id of ribbon button is hovering

Can I know the id of ribbon button is hovering

SandmanINV
Advocate Advocate
404 Views
3 Replies
Message 1 of 4

Can I know the id of ribbon button is hovering

SandmanINV
Advocate
Advocate

Hi everyone, 

Like my title topic, i want to know id of button which mouse is hovering on it.

Can I do this ?

Please give me some advise.

0 Likes
405 Views
3 Replies
Replies (3)
Message 2 of 4

Dev_rim
Advocate
Advocate

If there is something like that it would be "event". I'm working with events in my Add-in but i did not see anything like this. You can state active ribbon and then reach the all properties of tabs, panels, buttons.

Read about User Interface Manager in Inventor API.

If my answer is solved your problem, please mark it as Solution

Freundliche Grüße / Kind Regards
0 Likes
Message 3 of 4

SandmanINV
Advocate
Advocate

Thank you for your reply,

I can create my custom ribbon, Ok. 

But, I have something which i need to know what button is hover on it.

These buttons maybe are Default of inventor, or my custom buttons. Mybe i have to think about another way.

0 Likes
Message 4 of 4

JelteDeJong
Mentor
Mentor

You can run this iLogic rule and have a look at the file: "c:\temp\buttons.txt". It will contain all ribbon, tab, panel and control(/button) information

Dim lines As List(Of String) = New List(Of String)
For Each ribbon As Ribbon In ThisApplication.UserInterfaceManager.Ribbons
    lines.Add("Ribbon: " & ribbon.InternalName)
    For Each tab As RibbonTab In ribbon.RibbonTabs
        lines.Add("   Tab: " & tab.DisplayName & " - " & tab.InternalName)
        For Each panel As RibbonPanel In tab.RibbonPanels
            lines.Add("      panel: " & panel.DisplayName & " - " & panel.InternalName)
            For Each control As CommandControl In panel.CommandControls
                lines.Add("         control: " & control.DisplayName & " - " & panel.InternalName)
            Next
        Next
    Next
Next

Dim lines2 As List(Of String) = New List(Of String)
For Each item As String In lines
    lines2.Add(item.Replace(Constants.vbCr, " ").Replace(Constants.vbCrLf, " "))
Next

System.IO.File.AppendAllLines("c:\temp\buttons.txt", lines2)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes