In Revit, the user interface (UI) for a typical plugin is usually created during Revit’s startup process, utilizing the UIControlledApplication type within the OnStartup method of the IExternalApplication interface.
However, upon reviewing the SDK, I discovered that the UI can also be created using the UIApplication type. Through testing, I confirmed that it is possible to add UI elements after Revit has already launched.
Consider the following example code:
public class TestCommand : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication uiapp = commandData.Application;
RibbonPanel rb = uiapp.CreateRibbonPanel(uiapp.CreateRibbonTab("Capol"), "NewRibbonPanel");
return Result.Succeeded;
}
}













Must log in before commenting!
Sign Up