42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
|
|
|
|||
|
|
using Autodesk.Revit.Attributes;
|
|||
|
|
|
|||
|
|
using Autodesk.Revit.DB;
|
|||
|
|
using Autodesk.Revit.UI;
|
|||
|
|
|
|||
|
|
using Nice3point.Revit.Toolkit.External;
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace Szmedi.RvKits.DisplayTools
|
|||
|
|
{
|
|||
|
|
[Transaction(TransactionMode.Manual)]
|
|||
|
|
//打开ElementsControlDock窗口
|
|||
|
|
public class ElementsControlCmd : ExternalCommand
|
|||
|
|
{
|
|||
|
|
public override void Execute()
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (DockablePane.PaneExists(GlobalVariables.PaneId))
|
|||
|
|
{
|
|||
|
|
var pane = UiApplication.GetDockablePane(GlobalVariables.PaneId);
|
|||
|
|
if (pane.IsShown())
|
|||
|
|
{
|
|||
|
|
pane.Hide();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
pane.Show();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception e)
|
|||
|
|
{
|
|||
|
|
ErrorMessage = e.Message;
|
|||
|
|
LogAssists.WriteLog(e.StackTrace);
|
|||
|
|
Result = Result.Failed;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|