mcneel / rhino.inside

Sample Projects for Rhino.Inside
MIT License
382 stars 169 forks source link

Creating Rhino Viewport in AutoCAD pligin only works if the application is Hidden - undesirable #292

Open ThomasMahon opened 11 months ago

ThomasMahon commented 11 months ago

@kike-garbo

We need to add a Rhino viewport to our WPF application in AutoCAD. Its easy enough, however there is one issue:

While this isn't the end of the world, it causes two problems:

  1. Slower start-up times.
  2. The Rhino splash screen displays which we don't want to see.

We've found Rhino.UI.Dialogs.KillSplash() but this kicks in after a few seconds, meaning the splash screen still displays. We do not want the splash screen visible at all - similar to Rhino Inside Revit. And before you ask, we've used the same viewport control in Revit add-ins and it works just fine, so there must be a way of achieving the same result using Rhino in AutoCAD. Can you help?

ThomasMahon commented 11 months ago

Update:

I looked at the RiR repo and discovered one can do this to hide the splash screen:

        args.Add("/nosplash");
        //args.Add("/safemode");
        //args.Add("/notemplate");

        var hostWnd = Core.KeepUIOnTop ? hostMainWindow.Handle : IntPtr.Zero;
        core = new RhinoCore(args.ToArray(), WindowStyle.Hidden, hostWnd);