Closed RyanPatrickDaley closed 1 year ago
I noticed that you tried to call revit api after an http request returned. I believe that's the problem. (the "Download Window" comment) Your code after http request will be executed in a new thread. I suggest you to wrap these code in RevitTask.RunAsync again. It is ok to nest RevitTask calls.
Let me know if the issue had been resolved~
When I use RevitTast.RunAsync(), it seems to work most of the time. However, I occasionally still get the InvalidOperationException sometimes for running a method outside of the API context. It doesn't make any sense to me that it would only fail sometimes. Maybe its because I am trying to run it consecutively, and the thread is already busy. Maybe its because I have multiple transactions within the same RevitTask.RunAsync. Maybe its because it doesn't like running static methods. I'm not sure what the issue could be.