Hey All,
I am Learning to create Add-Ins with visual studio. I have created a few simple ones and now I am wanting to add them to the top ribbon/New tab. I have been to a few different sites and looked at different examples but I am still confused as to where the code it supposed to go to get the add-on on a new tab. From what I have read it appears the code(below) should go just after "IExternalCommand"
{ Also the "OnStartup" creates an error "Error CS0116 A namespace cannot directly contain members such as fields or methods"
CLICK ME
public Result OnStartup(UIControlledApplication application)
{
// Create a custom ribbon tab
String tabName = "This Tab Name";
application.CreateRibbonTab(tabName);
// Create two push buttons
PushButtonData button1 = new PushButtonData("Button1", "My Button #1",
@"C:\ExternalCommands.dll", "Revit.Test.Command1");
PushButtonData button2 = new PushButtonData("Button2", "My Button #2",
@"C:\ExternalCommands.dll", "Revit.Test.Command2");
// Create a ribbon panel
RibbonPanel m_projectPanel = application.CreateRibbonPanel(tabName, "This Panel Name");
// Add the buttons to the panel
List<RibbonItem> projectButtons = new List<RibbonItem>();
projectButtons.AddRange(m_projectPanel.AddStackedI tems(button1, button2));
return Result.Succeeded;
}
I am Learning to create Add-Ins with visual studio. I have created a few simple ones and now I am wanting to add them to the top ribbon/New tab. I have been to a few different sites and looked at different examples but I am still confused as to where the code it supposed to go to get the add-on on a new tab. From what I have read it appears the code(below) should go just after "IExternalCommand"
{ Also the "OnStartup" creates an error "Error CS0116 A namespace cannot directly contain members such as fields or methods"
CLICK ME
public Result OnStartup(UIControlledApplication application)
{
// Create a custom ribbon tab
String tabName = "This Tab Name";
application.CreateRibbonTab(tabName);
// Create two push buttons
PushButtonData button1 = new PushButtonData("Button1", "My Button #1",
@"C:\ExternalCommands.dll", "Revit.Test.Command1");
PushButtonData button2 = new PushButtonData("Button2", "My Button #2",
@"C:\ExternalCommands.dll", "Revit.Test.Command2");
// Create a ribbon panel
RibbonPanel m_projectPanel = application.CreateRibbonPanel(tabName, "This Panel Name");
// Add the buttons to the panel
List<RibbonItem> projectButtons = new List<RibbonItem>();
projectButtons.AddRange(m_projectPanel.AddStackedI tems(button1, button2));
return Result.Succeeded;
}