shlogg · Early preview
Chuongmep @chuongmep

Using Await Async In Revit Addin

Use Revit.Async library to run async tasks in Revit, or use IExternalCommand with Task.RunAsync for modeless dialogs.

The Revit API provides an External Events framework to accommodate the use of modeless dialogs. It is tailored for asynchronous processing and operates similarly to the Idling event with default frequency.
You can look at the official document from Revit API Revit API Developers Guide Advanced Topics External Events : 
But we can use more simple than with Revit.Async

  
  
  Use In IExternalCommand

Dowload Library Revit.Async from package nuget API manager


<PackageReference Include="Revit.Async" Version="2.1.*" />

    
    

    
    




Add Test Code:


using Autodesk.Revit.Attributes;...