0
public void BuildRibbon(UIControlledApplication application)
    {
        foreach (var bc in _container.GetExports<IExternalCommand, IButtonMetaData>().OrderBy(l => l.Metadata.PanelIndex))
        {
            var md = bc.Metadata;
            var cmdType = bc.Value.GetType();
            var assembly = cmdType.Assembly;
            var panel = application.RibbonPanel(bc.Metadata.TabName, bc.Metadata.PanelName);
             PushButton button;

            button = (PushButton)panel.AddItem(new PushButtonData(md.Name, md.Text, assembly.Location, cmdType.FullName));

            if (button == null) continue;

            button.Enabled = md.Enabled;
            button.Visible = md.Visible;
        }
    }

I am not able set the alignment of the PushButton inside RibbonPanel. I want to shift it to right side of the Panal. i need to set alignment property here and i won't be able to find any alignment property of push button

1 Answers1

0

Afaik, the Revit API does not provide any direct support for this. On the other hand, the push button is more or less a straight .NET object. Have you searched the standard .NET properties provided on it?

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17