-
Notifications
You must be signed in to change notification settings - Fork 1
/
AboutAddin.cs
42 lines (38 loc) · 1.51 KB
/
AboutAddin.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
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Bimbot.BimbotUI;
using Application = Autodesk.Revit.ApplicationServices.Application;
namespace Bimbot
{
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
[Journaling(JournalingMode.NoCommandData)]
class AboutAddin : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
//UIDocument uidoc = commandData.Application.ActiveUIDocument;
Application app = commandData.Application.Application;
#if R2016
// this version does not support the SubVersionNumber property
string revitVersion = app.VersionNumber;
#elif R2017
// this version does not support the SubVersionNumber property
string revitVersion = app.VersionNumber;
#else
string revitVersion = app.SubVersionNumber;
#endif
int major = 1; // major build version
int minor = 0; // minor/patch build version
int build = 6; // build number
string av = app.VersionNumber.Substring(0, 4); // revit version indicator
// show the about dialog for this addin
//AboutForm form = new AboutForm(revitVersion, $"{major}.{minor}.{av}.{build:0000}");
AboutForm form = new AboutForm(revitVersion, $"{major}.{minor}.{build:00}.{av}");
form.ShowDialog();
// autocancel for now as there is no effect in Revit that needs to be committed
return Result.Cancelled;
}
}
}