How to change button displayname

How to change button displayname

bradeneuropeArthur
Mentor Mentor
303 Views
2 Replies
Message 1 of 3

How to change button displayname

bradeneuropeArthur
Mentor
Mentor

How can I change the displayname/text of a button or other solution.

The displayname object is readonly...

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Accepted solutions (1)
304 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

You could simulate this by deleting the button and creating a new one. With the script below I made a button with a rolling text. (I did run this from an external application. I could not make it work from iLogic)

RollingButton.gif

 

Sub main()

    Dim buttonText = "Rolling Button "

    Dim ribbon As Ribbon = ThisApplication.UserInterfaceManager.Ribbons.Item("Assembly")
    Dim ribbonTab As RibbonTab = ribbon.RibbonTabs.Item("id_TabManage")
    Dim ribbonPanel As RibbonPanel = ribbonTab.RibbonPanels.Item("iLogic.RibbonPanel")

    Dim rollingButtonTemp = CreateRollingButton(buttonText)
    Dim control = ribbonPanel.CommandControls.AddButton(rollingButtonTemp)

    Try
        For index1 = 1 To 10
            For index = 0 To buttonText.Length

                Dim part1 = buttonText.Substring(0, index)
                Dim part2 = buttonText.Substring(index)
                buttonText = part2 + part1

                control.Delete()
                Dim rollingButton = CreateRollingButton(buttonText)
                control = ribbonPanel.CommandControls.AddButton(rollingButton)


                Thread.Sleep(500)
            Next
        Next

    Catch ex As Exception

    End Try

    control.Delete()
End Sub

Private Function CreateRollingButton(txt As String)
    Dim conDefs As ControlDefinitions = ThisApplication.CommandManager.ControlDefinitions
    Return conDefs.AddButtonDefinition(
        txt,
        "MyButton InternalName" + Guid.NewGuid.ToString(),
        CommandTypesEnum.kEditMaskCmdType,
        Guid.NewGuid().ToString(),
        "MyButton DescriptionText",
        "MyButton ToolTipText")
End Function

 

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

Message 3 of 3

bradeneuropeArthur
Mentor
Mentor

Same thought. I was searching for something else. But I think indeed this is the only option.

 

Thanks for confirmation and you helping hand.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes