-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExternalApplication.cs
More file actions
36 lines (32 loc) · 1.23 KB
/
Copy pathExternalApplication.cs
File metadata and controls
36 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
namespace NEWREVITADDIN
{
public class ExternalApplication : IExternalApplication
{
public Result OnShutdown(UIControlledApplication application)
{
return Result.Succeeded;
}
public Result OnStartup(UIControlledApplication application)
{
string tabName = "Chess Game";
string path = Assembly.GetExecutingAssembly().Location;
application.CreateRibbonTab(tabName);
RibbonPanel panel = application.CreateRibbonPanel(tabName, tabName);
PushButtonData button = new PushButtonData("button1", "Start Match", path, "NEWREVITADDIN.StartGame");
PushButtonData button1 = new PushButtonData("button2", "Ball Bounce", path, "NEWREVITADDIN.BounceBall");
BitmapImage image = new BitmapImage(new Uri("pack://application:,,,/NewRibbon;component/favicon.ico"));
button.LargeImage = image;
panel.AddItem(button);
panel.AddItem(button1);
return Result.Succeeded;
}
}
}