Add addin to existing ribbon

Add addin to existing ribbon

Anonymous
Not applicable
1,441 Views
1 Reply
Message 1 of 2

Add addin to existing ribbon

Anonymous
Not applicable

Hi,

I created an addin that has a tab with a few buttons on it but not enough to fill up the full tab. What i would like to take the panels that have created and  see if it is possible to add it to a tab  that already exists like "CTC Tools" just to simplify access locations for the users in the office. Is it possible to add on to a tab without creating it first? I know that if I don't create a tab the panel will be placed on the Add-ins Tab but for some users that is filled up. And I also know that if I try creating 2 panels with the same name that only the first one it loads will show up.

 

public Result OnStartup(UIControlledApplication application) 
{

AddDfltWkstRibbon(application);
}
public void AddDfltWkstRibbon(UIControlledApplication application) { // create ribbon tab //String TabName = "General"; //application.CreateRibbonTab(TabName); String PanelName = "Worksets"; RibbonPanel PanelRibbon = application.CreateRibbonPanel(PanelName); string msg = "Sets the workset and also sets a user prefered workset."; PushButtonData wkst = new PushButtonData("DfltWorkset", "Default" + Environment.NewLine + "Workset", ExecutingAssemblyPath, ExecutingAssemblyName + ".CmdSetWorkset") { ToolTip = msg }; PushButton pb = PanelRibbon.AddItem(wkst) as PushButton; }

Thanks in Advance

0 Likes
1,442 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

Dear William,

 

Thank you for your query.

 

Yes, this can be done:

 

http://thebuildingcoder.typepad.com/blog/2013/02/adding-a-button-to-existing-ribbon-panel.html

 

Please always search the Internet and the blog before asking a question.

 

That said, please be very careful using this.

 

Note that this approach is not officially supported by the Revit6 API:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#4

 

I heard rumours that adding custom add-in buttons to existing built-in Revit ribbon panels may have caused serious crashes in the past.

 

As always, test carefully and thoroughly before letting this loose on unsuspecting customers.

 

I hope this helps.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes