-
Notifications
You must be signed in to change notification settings - Fork 47
/
EntryCommandSeparateThread.cs
34 lines (30 loc) · 1.01 KB
/
EntryCommandSeparateThread.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
#region Namespaces
using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
#endregion
namespace RevitTemplate
{
/// <summary>
/// This is the ExternalCommand which gets executed from the ExternalApplication. In a WPF context,
/// this can be lean, as it just needs to show the WPF. Without a UI, this could contain the main
/// order of operations for executing the business logic.
/// </summary>
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class EntryCommandSeparateThread : IExternalCommand
{
public virtual Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
try
{
App.ThisApp.ShowFormSeparateThread(commandData.Application);
return Result.Succeeded;
}
catch (Exception ex)
{
message = ex.Message;
return Result.Failed;
}
}
}
}