添加项目文件。
This commit is contained in:
47
RevitKits/ParameterManager/AddParamsCmd.cs
Normal file
47
RevitKits/ParameterManager/AddParamsCmd.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user