Solidworks' frozen UI

How do you keep the SolidWorks UI responsive after triggering methods in your code asynchronously?

Using Task.Run() is not advisable because you’re manipulating COM objects.

SolidWorks isn’t really built for doing things asynchronously, so I don’t use it. I only use Task.Run when refreshing a license, for example, so I can show a moving spinner in the UI.

Sometimes batch processing models is too slow for my liking, but you can turn off many solidworks features to make it faster.

What are you building, and what needs to be done asynchronously?

That’s the reason why I build my own UI’s with WPF or Blazor… but yes, with that you have then other problems :sweat_smile:

You can achieve some level of responsiveness by offloading progress reporting to Windows-native API controls. One useful library is ookii-dialogs/ookii-dialogs-wpf, which provides dialog controls that appear to run on a separate process, improving UI responsiveness during long operations.

You can copy paste the code from their repo. I am using something similar.