53 lines
1.3 KiB
C#
53 lines
1.3 KiB
C#
|
|
using System;
|
|
using System.Windows;
|
|
using System.Windows.Interop;
|
|
|
|
using Autodesk.Revit.Attributes;
|
|
using Autodesk.Revit.DB;
|
|
|
|
using Nice3point.Revit.Toolkit.External;
|
|
|
|
using Szmedi.RvKits.Assists;
|
|
|
|
|
|
namespace Szmedi.RvKits.InfoManager
|
|
{
|
|
[Transaction(TransactionMode.Manual)]
|
|
|
|
public class ParamManagerCmd : ExternalCommand
|
|
{
|
|
|
|
public override void Execute()
|
|
{
|
|
if (WinIntPtr.IsVisible("深圳市交付标准"))
|
|
{
|
|
WinIntPtr.ShowAndActive("深圳市交付标准");
|
|
}
|
|
else
|
|
{
|
|
//AssemblyLoaderHelpers loader = new(GlobalVariables.DirAssembly);
|
|
//loader.HookAssemblyResolve();
|
|
try
|
|
{
|
|
ParamManagerWin win =
|
|
new(UiApplication);
|
|
|
|
new WindowInteropHelper(win) { Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle };
|
|
win.Show();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
MessageBox.Show(e.Message);
|
|
LogAssists.WriteLog(e.StackTrace);
|
|
}
|
|
finally
|
|
{
|
|
|
|
//loader.UnhookAssemblyResolve();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|