Hi Everybody,
I'm actually doing my first Revit Addin, so sorry for the basics knowledges about the API.
For this Addin I did a new ribbon tab with all the new function inside.
I often use these functions with Standard functions from the Architecture tab, and I always need to switch between these 2 Ribbon Tab.
To minimize the miles covered by the mouse, do you know if it's possible to take few of these "Revit original function", with the button, and to add them in my personalized Ribbon tab ?
I don't know if my question was clear, if you need other informations do not hesitate to contact me.
Best Regards,
Solved! Go to Solution.
Solved by FAIR59. Go to Solution.
You could create an IExternalCommand that overrides the Revit built in command and posts it but you'd have to replicate all the icons and that seems a bit extreme. Not all built-in command can be posted however.
You could also pull the command button out of the ribbon and have them floating. In the below I'm drawing lines but I have the spelling button floating; you never know when you might need to check the spelling of a line. There is also the quick access area.
it is possible to replace them, so maybe you can do copy from it too:
read this, maybe it will help:
http://thebuildingcoder.typepad.com/blog/2012/06/replacing-built-in-commands-and-their-ids.html
Assuming your Addin is an ExternalApplication, you can indeed add a "standard" button to your tab.
this code should give you the Aligned Dimension button in your tab.
// reference AdWindows.dll // using adWin = Autodesk.Windows; // my_tab and my_panel created in OnStartup() // application.CreateRibbonTab("FAIR"); // m_ribbonPanel = application.CreateRibbonPanel("FAIR", "myPanel"); // applicationInitialized declared in OnStartup() // application.ControlledApplication.ApplicationInitialized += ControlledApplication_ApplicationInitialized; void ControlledApplication_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { adWin.RibbonControl ribbon = adWin.ComponentManager.Ribbon; adWin.RibbonPanel my_Panel = null; foreach (var tab in ribbon.Tabs) { foreach ( var panel in tab.Panels) { if (panel.Source.Title == "myPanel") { my_Panel = panel; break; } } if (my_Panel != null) break; } adWin.RibbonItem originalCommandItem = ribbon.FindItem("ID_ANNOTATIONS_DIMENSION_ALIGNED", false); if (my_Panel!=null && originalCommandItem!=null) { my_Panel.Source.Items.Add(originalCommandItem); }
}
Thanks,
Works great in my code.
Just a question where did you found a list of the ribbon items? (ID_ANNOTATIONS_DIMENSION_ALIGNED)
I couldn't find them in the API Docs.
there is a reference to a list (txt- or Excel format) on the BuildingCoder page http://thebuildingcoder.typepad.com/blog/2012/06/replacing-built-in-commands-and-their-ids.html
Can't find what you're looking for? Ask the community or share your knowledge.