During development, a common issue arises when working with plugin windows. After opening the plugin window, switching to other applications, covering Revit, and then returning to Revit, the plugin window often disappears, giving the impression that it has crashed. To prevent this, it is essential to bind the plugin window to the main application window. This can be achieved by adding two lines of code before calling ShowDialog():
System.Windows.Interop.WindowInteropHelper mainUI = new System.Windows.Interop.WindowInteropHelper(view);
mainUI.Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
view.ShowDialog();
xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat













Must log in before commenting!
Sign Up