how leverage Revit’s Idling event to queue up work to be done inside these code…
- User
how leverage Revit’s Idling event to queue up work to be done inside these code
namespace MyRevitPlugin { public class Class1 : IExternalApplication {
codepublic Result OnStartup(UIControlledApplication application) { RibbonPanel ribbonPanel = application.CreateRibbonPanel("MyRibbonPanel"); // Create a button to trigger some command and add it to the Ribbon Panel string thisAssemblyPath = Assembly.GetExecutingAssembly().Location; PushButtonData buttonData = new PushButtonData("cmdMyTest", "My HV Test", thisAssemblyPath, "MyRevitPlugin.HttpServerCommand3"); PushButton pushButton = ribbonPanel.AddItem(buttonData) as PushButton; // optionally, you can add other properties to the button, like for example a Tool-Tip pushButton.ToolTip = "Hello, this is my first Revit Plug-in"; // Bitmap Icon Uri urlImage = new Uri(@"C:\Users\HarshVardhan\OneDrive - Intelliswift Software Inc\Desktop\HVRevit\ml2.png"); BitmapImage bitmapImage = new BitmapImage(urlImage); pushButton.LargeImage = bitmapImage; return Result.Succeeded; } public Result OnShutdown(UIControlledApplication application) { return Result.Succeeded; } }[Transaction(TransactionMode.Manual)] [Regeneration(RegenerationOption.Manual)] public class HttpServerCommand3 : IExternalCommand { private static HttpListener listener; //private static object commandData; private const string Url = "http://localhost:12345/revit/";
code - Assistant