Hi @AndrewButenko!
It is not exposed in public API as @Mustafa.Salaheldin said, but that does not mean, you can't do it. There is a dark unofficial way to achieve this. You should reference AdWindows.dll and UIFramework.dll and execute something like the code below. Be careful to use Revit API in CommandHandler, you are not in safe mode at this point. You should register EventHandler and raise it. Look at Samples\ModelessDialog\ModelessForm_ExternalEvent from Revit SDK
var tab = Autodesk.Windows.ComponentManager
.Ribbon
.Tabs
.First(x => x.Title == "Manage");
var panelSource = tab
.Panels
.Select(x => x.Source)
.Single(x => x.AutomationName == "Project Location");
var ribbonButton = new Autodesk.Windows.RibbonButton
{
Id = "MY_DIALOG_LAUNCHER",
Name = "My launcher",
Text = "My launcher title",
IsEnabled = true,
CommandHandler = new RelayCommand(o => true, o => MessageBox.Show("dev"))
};
panelSource.DialogLauncher = ribbonButton;
// .....
public class RelayCommand : ICommand
{
private readonly Predicate<object> canExecute;
private readonly Action<object> execute;
public RelayCommand(Predicate<object> canExecute, Action<object> execute)
{
this.canExecute = canExecute;
this.execute = execute;
}
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public bool CanExecute(object parameter)
{
return canExecute(parameter);
}
public void Execute(object parameter)
{
execute(parameter);
}
}