Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Dec 11, 2023
1 parent e70fc2e commit 233717e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
1 change: 1 addition & 0 deletions ricaun.Revit.UI.StatusBar/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public Result OnStartup(UIControlledApplication application)
ribbonPanel.RowStackedItems(
ribbonPanel.CreatePushButton<Commands.CommandRevit>("Revit"),
ribbonPanel.CreatePushButton<Commands.CommandNone>("None"),
ribbonPanel.CreatePushButton<Commands.CommandNoneLong>("NoneLong"),
ribbonPanel.CreatePushButton<Commands.CommandTheme>("Theme"),
ribbonPanel.CreatePushButton<Commands.CommandDelayIndeterminate>("Delay"),
ribbonPanel.CreatePushButton<Commands.CommandElements>("Elements"),
Expand Down
5 changes: 2 additions & 3 deletions ricaun.Revit.UI.StatusBar/Revit/Commands/CommandNone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme
{
revitProgressBar.SetCurrentOperation(uiapp.Application.VersionName);
revitProgressBar.SetHasCancelButton(true);
revitProgressBar.Run(1000000, (i) =>
revitProgressBar.Run(10000, (i) =>
{
//revitProgressBar.SetIsIndeterminate(false);
//revitProgressBar.SetCurrentOperation($"{uiapp.Application.VersionName} [{i}]");
});
}

Expand Down
32 changes: 32 additions & 0 deletions ricaun.Revit.UI.StatusBar/Revit/Commands/CommandNoneLong.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace ricaun.Revit.UI.StatusBar.Revit.Commands
{
[Transaction(TransactionMode.Manual)]
public class CommandNoneLong : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
{
UIApplication uiapp = commandData.Application;

var stopwatch = System.Diagnostics.Stopwatch.StartNew();

using (var revitProgressBar = new RevitProgressBar())
{
revitProgressBar.SetCurrentOperation(uiapp.Application.VersionName);
revitProgressBar.SetHasCancelButton(true);
revitProgressBar.Run(1000000, (i) =>
{
});
}

System.Console.WriteLine($"Stopwatch: {stopwatch.ElapsedMilliseconds}");

return Result.Succeeded;
}
}

}
5 changes: 1 addition & 4 deletions ricaun.Revit.UI.StatusBar/RevitProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,7 @@ public void Dispose()
StatusBarController.Hide();
stopwatch.Stop();

if (ForceToRefresh)
{
RefreshBackground(true);
}
RefreshBackground(ForceToRefresh);
}

/// <summary>
Expand Down

0 comments on commit 233717e

Please sign in to comment.