47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using System;
|
|
using System.Windows.Interop;
|
|
using Autodesk.Revit.Attributes;
|
|
using Autodesk.Revit.DB;
|
|
using Autodesk.Revit.UI;
|
|
using Sai.Common.Shared.ParameterManager;
|
|
using Sai.RvKits.IO;
|
|
using Sai.RvKits.Operation;
|
|
|
|
namespace SZBIM.StandardTools.ParameterManager
|
|
{
|
|
[Transaction(TransactionMode.Manual)]
|
|
[Regeneration(RegenerationOption.Manual)]
|
|
public class AddParamsCmd : IExternalCommand
|
|
{
|
|
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
{
|
|
Autodesk.Revit.ApplicationServices.Application app = commandData.Application.Application;
|
|
|
|
|
|
if (WinIntPtr.IsVisible("Ìí¼Ó²ÎÊý"))
|
|
{
|
|
WinIntPtr.ShowAndActive("Ìí¼Ó²ÎÊý");
|
|
}
|
|
else
|
|
{
|
|
AddParamsViewModel viewModel = new AddParamsViewModel(app);
|
|
try
|
|
{
|
|
var win = new AddParamsWin(viewModel);
|
|
|
|
_ = new WindowInteropHelper(win)
|
|
{
|
|
Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle
|
|
};
|
|
win.Show();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogUtil.WriteLog(ex.Message);
|
|
}
|
|
}
|
|
|
|
return Result.Succeeded;
|
|
}
|
|
}
|
|
} |