-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathApp.cs
33 lines (29 loc) · 1.21 KB
/
App.cs
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
using Autodesk.Revit.UI;
using System;
using System.Reflection;
using System.Windows.Media.Imaging;
namespace CurvedInsulation
{
public class App : IExternalApplication
{
static void AddRibbonPanel(UIControlledApplication application)
{
RibbonPanel panel = application.CreateRibbonPanel("Insulation");
string path = Assembly.GetExecutingAssembly().Location;
PushButtonData data = new PushButtonData("Curved", "Curved", path, "CurvedInsulation.Draw");
PushButton button = panel.AddItem(data) as PushButton;
button.ToolTip = "Draw Curved Insulation. Pick a reference Insulation Batting and then the arc or line be applied to.";
BitmapImage image = new BitmapImage(new Uri("pack://application:,,,/CurvedInsulation;component/Resources/CurvedInsulation.png"));
button.LargeImage = image;
}
public Result OnStartup(UIControlledApplication application)
{
AddRibbonPanel(application);
return Result.Succeeded;
}
public Result OnShutdown(UIControlledApplication application)
{
return Result.Succeeded;
}
}
}