-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommand2.cs
50 lines (42 loc) · 1.53 KB
/
Command2.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#region Namespaces
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
#endregion
namespace BootCamp
{
[Transaction(TransactionMode.Manual)]
public class Command2 : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
// this is a variable for the Revit application
UIApplication uiapp = commandData.Application;
// this is a variable for the current Revit model
Document doc = uiapp.ActiveUIDocument.Document;
// Your code goes here
TaskDialog.Show("Create Ribbon", "Button 2");
return Result.Succeeded;
}
internal static PushButtonData GetButtonData()
{
// use this method to define the properties for this command in the Revit ribbon
string buttonInternalName = "btnCommand2";
string buttonTitle = "Button 2";
ButtonDataClass myButtonData1 = new ButtonDataClass(
buttonInternalName,
buttonTitle,
MethodBase.GetCurrentMethod().DeclaringType?.FullName,
Properties.Resources.Blue_32,
Properties.Resources.Blue_16,
"This is a tooltip for Button 2");
return myButtonData1.Data;
}
}
}