How to change the ribbon tab displayname

How to change the ribbon tab displayname

Anonymous
Not applicable
4,738 Views
15 Replies
Message 1 of 16

How to change the ribbon tab displayname

Anonymous
Not applicable

Hi All,

I have created a plugin for Navisworks, however, I couldn't change the Ribbon Tab display name, here is my code:

 

<AddInPlugin(AddInLocation.AddIn,
CanToggle:=True,
LoadForCanExecute:=True,
CallCanExecute:=CallCanExecute.Always,
Icon:="Resources\\icon",
LargeIcon:="Resources\\logo",
Shortcut:="Ctrl+Shift+O",
ShortcutWindowTypes:="")>
<PluginAttribute("navs.ltf_pw_nw_open__",
"LTFD",
ToolTip:="Open a document ",
DisplayName:="Open")>
Public Class ltf_nw_open__
Inherits AddInPlugin

Public Overrides Function Execute(ByVal ParamArray parameters As String()) As Integer
End Function

End Class

 

 

and here is the title bar

 

Capture.PNG

 

 

Thank you.

0 Likes
4,739 Views
15 Replies
Replies (15)
Message 2 of 16

Anonymous
Not applicable
0 Likes
Message 3 of 16

Anonymous
Not applicable

thank you Jhjang, 

I'm using windows form. 

 

Message 4 of 16

Anonymous
Not applicable

Hello @Anonymous!

I'm having the same struggle as you, how did you end up solving this issue? The blog posted above did not help me because for it to work the class needs to inherit from CommandHandlerPlugin.

 

Regards,

 

JMGP

0 Likes
Message 5 of 16

Anonymous
Not applicable

hi, 

Here is the code on my class

 <PluginAttribute("doxenter_commands__", "DOCX", ToolTip:="DoXenter", DisplayName:="DoXenter")>
    <RibbonLayoutAttribute("doxenter_ribbon.xaml")>
    <RibbonTabAttribute("ID_Tab_1")>
    <CommandAttribute("PW_OPEN_DOCUMENT__",
                      DisplayName:="    Open    ",
                      Icon:="Resources\\logo",
                      LargeIcon:="Resources\\logo",
                      ToolTip:="Open document from ProjectWISE",
                      CallCanExecute:=CallCanExecute.Always,
                      CanToggle:=True,
                      LoadForCanExecute:=True,
                      ShortcutWindowTypes:="")>
Public Class CustomRibbonCommandHandler Inherits CommandHandlerPlugin
....your code....


Now, in the plugins folder, which stays normally in

C:\Program Files\Autodesk\Navisworks Manage 2017\Plugins\

Add your plugin folder and add the following folder:

 

1 - En-Us (or whatever resource folder you are using)

2 - images

3 - And your dll  file

 

Hope it helps 🙂

 

 

Message 6 of 16

Anonymous
Not applicable

Thank you @Anonymous

I have something VERY similar to you, but the difference is that I inherit my class from AddInPlugin instead of CommandHandlerPlugin and I can't change that because of some functionalities that are specific for AddIn. I saw that your first post was inheriting from AddInPlugin. Do you know something about customizing limitations regarding the inheritance?

 

Regards,

JMGP

0 Likes
Message 7 of 16

Anonymous
Not applicable

I think the trick is to put copy the resource folder  + images + dll file in the same folder under the plugin folder 

C:\Program Files\Autodesk\Navisworks Manage 2017\Plugins\

 for my case, if I delete any of these files, it won't work.

 

2 - Try to give access to everyone to the folder 

C:\Program Files\Autodesk\Navisworks Manage 2017

image.png

0 Likes
Message 8 of 16

Anonymous
Not applicable

Hello again @Anonymous

 

Tried and didnt work. I'll provide the relevant part of the code with the output to see if you see any anomalies. 

 

CS File:

[Plugin("Timeliner.DumpTimelinerTasks", // Plugin name
"ADSK", // Developer ID or GUID
ToolTip = "DIPDIPDULIDU", // The tooltip for the item in the ribbon
DisplayName = "HELLO")] // Display name for the Plugin in the Ribbon

[Strings("ADNRibbonDemo.name")]
[RibbonLayout("ADNRibbonDemo.xaml")]
[RibbonTab("ID_CustomTab_1", DisplayName = "HELLO")]
[Command("ID_Button_1", Icon = "uno.ico", LargeIcon = "dos.ico", ToolTip = "Show a message")]

 

public class DumpTimelinerTasks : AddInPlugin

 

XAML File:

 

<RibbonControl
x:Uid="ADNRibbonDemo" xmlns="clr-namespace:Autodesk.Windows;assembly=AdWindows"
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:adwi="clr-namespace:Autodesk.Internal.Windows;assembly=AdWindows"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Autodesk.Navisworks.Gui.Roamer.AIRLook;assembly=navisworks.gui.roamer">
<!-- END STANDARD SECTION DO NOT EDIT -->

<RibbonTab Id="ID_CustomTab_1" KeyTip="T1">
<RibbonPanel x:Uid="RibbonPane1_1">
<RibbonPanelSource x:Uid="RibbonPanelSource_RibbonPanel_1" KeyTip="C1" Title="Large Button">

<local:NWRibbonButton x:Uid="Button_1" Id="ID_Button_1"
Size="Large"
KeyTip="B1"
ShowText="True"
Text="Button 1 in xaml"
Orientation="Vertical"/>

</RibbonPanelSource>
</RibbonPanel>

</RibbonTab>
</RibbonControl>

 

Output:

ssresultados.PNG

 

So neither the "Tools add-ins 1" and the picture/logo changed.

 

Any ideas?

 

0 Likes
Message 9 of 16

Ning_Zhou
Advocate
Advocate

Navisworks 2019, how to change default name "Tool add-ins 1", really no solution at all?

0 Likes
Message 10 of 16

Anonymous
Not applicable
Message 11 of 16

Hugo.Bergeron
Contributor
Contributor

I also tried building the demo provided by xiaodong-liang and Tab wont appear in the Navisworks ribbon.

I can create a plugin that shows up in the "Tools add-ins 1" (nice name), I just cant create a simple Tab in the Ribbon with a single button that runs a command...
Anyone has a working demo?
Please dont link to https://adndevblog.typepad.com/aec/2012/07/custom-ribbon-of-navisworks-part-1.html as even the source code builds but wont do anything in Navisworks.
Love how Autodesk breaks plugin between releases too... Talk about backward compatibility.

0 Likes
Message 12 of 16

ulski1
Collaborator
Collaborator
I don't have a sample project for you but I can say that naming custom tabs works fine in Navisworks 2021 in my code
0 Likes
Message 13 of 16

Hugo.Bergeron
Contributor
Contributor

Thanks, can you specify the differences between the Autodesk demo (from 2012) and your code?

0 Likes
Message 14 of 16

ulski1
Collaborator
Collaborator
That I don’t recall but a common mistake is forgetting to copy the extra files such as resource files into the plug-in folder
0 Likes
Message 15 of 16

Hugo.Bergeron
Contributor
Contributor
Yeah but no, xaml and .txt (or .name) files set to always copy
0 Likes
Message 16 of 16

swarali_kulkarni4KMYK
Alumni
Alumni

How we can create a .xaml file? is it a WPF  or Windows form .xaml file?
I am confused if we inherited the class from the AddInPlugin class rather than the CommandHandlerPlugin,  is it not possible to change the display name of the plugin?