Files
ShrlAlgoToolkit/ShrlAlgoToolkit.RevitAddins/DrawSheet/ElementsControlCmd.cs

37 lines
898 B
C#
Raw Normal View History

2025-12-23 21:35:54 +08:00

using Autodesk.Revit.Attributes;
2024-09-22 11:05:41 +08:00
using Nice3point.Revit.Toolkit.External;
2026-02-21 16:31:24 +08:00
using ShrlAlgoToolkit.RevitAddins.Common.Assists;
2026-02-22 20:03:42 +08:00
namespace ShrlAlgoToolkit.RevitAddins.DrawSheet;
2024-09-22 11:05:41 +08:00
[Transaction(TransactionMode.Manual)]
2025-12-23 21:35:54 +08:00
//打开ElementsControlDock窗口
2024-09-22 11:05:41 +08:00
public class ElementsControlCmd : ExternalCommand
{
public override void Execute()
{
2025-12-23 21:35:54 +08:00
try
2024-09-22 11:05:41 +08:00
{
2025-12-23 21:35:54 +08:00
if (DockablePane.PaneExists(Variables.PaneId))
2024-09-22 11:05:41 +08:00
{
2025-12-23 21:35:54 +08:00
var pane = UiApplication.GetDockablePane(Variables.PaneId);
if (pane.IsShown())
{
pane.Hide();
}
else
{
pane.Show();
}
2024-09-22 11:05:41 +08:00
}
}
2025-12-23 21:35:54 +08:00
catch (Exception e)
{
ErrorMessage = e.Message;
e.StackTrace.ToLog();
Result = Result.Failed;
}
2024-09-22 11:05:41 +08:00
}
2025-12-23 21:35:54 +08:00
}