Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created July 20, 2020 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/42a461e5143911d71c73cf1d39f95ee8 to your computer and use it in GitHub Desktop.
Save chuongmep/42a461e5143911d71c73cf1d39f95ee8 to your computer and use it in GitHub Desktop.
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
class Command : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication uiapp = commandData.Application;
if (DockablePane.PaneIsRegistered(App.PaneId))
{
DockablePane docpanel = uiapp.GetDockablePane(App.PaneId);
if (docpanel.IsShown())
docpanel.Hide();
else
docpanel.Show();
}
else
{
return Result.Failed;
}
return Result.Succeeded;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment