ricaun.Revit.UI.StatusBar
1.0.0
Prefix Reserved
dotnet add package ricaun.Revit.UI.StatusBar --version 1.0.0
NuGet\Install-Package ricaun.Revit.UI.StatusBar -Version 1.0.0
<PackageReference Include="ricaun.Revit.UI.StatusBar" Version="1.0.0" />
paket add ricaun.Revit.UI.StatusBar --version 1.0.0
#r "nuget: ricaun.Revit.UI.StatusBar, 1.0.0"
// Install ricaun.Revit.UI.StatusBar as a Cake Addin #addin nuget:?package=ricaun.Revit.UI.StatusBar&version=1.0.0 // Install ricaun.Revit.UI.StatusBar as a Cake Tool #tool nuget:?package=ricaun.Revit.UI.StatusBar&version=1.0.0
ricaun.Revit.UI.StatusBar
Package to create a progress bar in Revit StatusBar for Revit API developers.
This project was generated by the ricaun.AppLoader Revit plugin.
RevitProgressBarUtils
The RevitProgressBarUtils
has some utility methods to Run a loop and update the RevitProgressBar
.
RevitProgressBarUtils.Run("Revit Elements", elements, (element) =>
{
System.Console.WriteLine(element.Name);
});
int repeat = 100000;
RevitProgressBarUtils.Run("Revit Repeat", repeat, (i) =>
{
System.Console.WriteLine(i);
});
RevitProgressBar
The RevitProgressBar
class implements the IDisposable
interface, so it can be used in a using
statement.
using (var progressBar = new RevitProgressBar())
{
progressBar.Run("Revit Elements", elements, (element) =>
{
System.Console.WriteLine(element.Name);
}
}
or...
using (var progressBar = new RevitProgressBar())
{
progressBar.SetCurrentOperation("Revit Elements");
foreach (var element in elements)
{
progressBar.Increment();
System.Console.WriteLine(element.Name);
}
}
Example
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using ricaun.Revit.UI.StatusBar;
namespace RevitAddin.Commands
{
[Transaction(TransactionMode.Manual)]
public class CommandRevit : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
{
UIApplication uiapp = commandData.Application;
RevitProgressBarUtils.Run(uiapp.Application.VersionName, 100, (i) =>
{
System.Threading.Thread.Sleep(i);
});
return Result.Succeeded;
}
}
}
Utils
BalloonUtils
The BalloonUtils
class has some utility methods to show a balloon in Revit UI.
BalloonUtils.Show("Message", "Title/Category");
Release
References
This project was inspired by OptionsBar.
License
This project is licensed under the MIT Licence.
Do you like this project? Please star this project on GitHub!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0-windows7.0 is compatible. net8.0-windows was computed. net8.0-windows7.0 is compatible. |
.NET Framework | net47 is compatible. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.7
- No dependencies.
-
net7.0-windows7.0
- No dependencies.
-
net8.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 621 | 12/15/2023 |