29 lines
847 B
C#
29 lines
847 B
C#
|
|
using Autodesk.Revit.UI;
|
|||
|
|
|
|||
|
|
using System;
|
|||
|
|
|
|||
|
|
namespace WebUITest
|
|||
|
|
{
|
|||
|
|
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
|||
|
|
public class Command : IExternalCommand
|
|||
|
|
{
|
|||
|
|
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var uiApp = commandData.Application;
|
|||
|
|
var uiDoc = uiApp.ActiveUIDocument;
|
|||
|
|
var wnd = new WebUIWindow(uiDoc);
|
|||
|
|
wnd.Owner = System.Windows.Application.Current?.MainWindow;
|
|||
|
|
wnd.ShowDialog();
|
|||
|
|
return Result.Succeeded;
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
message = ex.Message;
|
|||
|
|
return Result.Failed;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|