更新整理
This commit is contained in:
28
WebUITest/Command.cs
Normal file
28
WebUITest/Command.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user