Example #1
0
        public Result OnStartup(UIControlledApplication application)
        {
            RibbonPanel ribbonPanel = application.CreateRibbonPanel("ShowMessage");

            string assemblyPath        = Assembly.GetExecutingAssembly().Location;
            string smallBitmapFileName = "revit.png";

            var buttons = new PluginCommandButton[] { new PluginCommandButton("button1Name", "Message Box", assemblyPath, "ShowMessagePlugin.Commands.ShowMessageBox", smallBitmapFileName, "messagebox.png", "Opens a Windows form", true, true),
                                                      new PluginCommandButton("button2Name", "Model Text", assemblyPath, "ShowMessagePlugin.Commands.ShowModelText", smallBitmapFileName, "modelspace.jpg", "Add text to model space") };

            RevitAPI.AddSplitButtonGroup(ribbonPanel, "SplitGroup1", "Show Message", buttons);

            return(Result.Succeeded);
        }
Example #2
0
 public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
 {
     return(RevitAPI.AddModelText(commandData.Application.ActiveUIDocument, "Show Message", message));
 }