How to Update the Status of External Process to AutoCAD CommandLine

By Madhukar Moogala

Let us assume you have a .Net command that runs an external process that takes a long time to complete. While you are waiting for it to complete you can output a progress indicator to the command line :

Note: Following procedure works only .NET 4.5, as I’m incorporating await and aysnc methods.

[CommandMethod("TestCommand")]
static public void TestCommand()
{
Method1();
}
static public async void Method1()
{
try
{
var doc = Application.DocumentManager.MdiActiveDocument;
var ed = doc.Editor;
for (int i = 0; i < 20; i++)
{
ed.WriteMessage("Processing {0}...", i);
string result = await WaitASynchronously();
ed.WriteMessage("Done.n");
}
}
catch (System.Exception ex)
{
Application.ShowAlertDialog("Error: " + ex.Message);
}
}
static public async Task WaitASynchronously()
{
await Task.Delay(500);
return "Finished";
}

Comments

5 responses to “How to Update the Status of External Process to AutoCAD CommandLine”

  1. There’s a lot of useful stuff on the sharing site that everyone should check out; I do it regularly.

  2. Looking for a great app to watch movies on your Android device? Pikashow is a great option that offers a huge library of both classic and new releases. Best of all, it’s completely free to download and use!
    Pikashow
    Pikashow

  3. Cryptocurrencies have revolutionized the financial landscape, offering a decentralized and secure method of conducting transactions. As the popularity of digital currencies continues to soar, cryptocurrency exchange platforms have become crucial for buying, selling, and managing these digital assets. One such prominent player in the market is Coinbase. In this article, we will explore the importance of Coinbase, how to download it, and its features, ensuring you embark on your crypto journey with confidence.
    Coinbase App | Coinbase Download

  4. hazel jones Avatar
    hazel jones

    Explore essential accessories to enhance your Genyt usage. Find the perfect add-ons for an improved experience.
    Get access to the latest movies on Filmywap. Learn how to download them for entertainment on the go.
    genyt |
    filmywap

  5. hazel jones Avatar
    hazel jones

    Get the best movie experience with 9kmovies. Download the latest films in HD quality today!
    A detailed comparison of Filmyzilla with other movie download platforms. Find out which one suits your preferences.
    9kmovies
    filmyzilla

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading