Using schemes to load / unload plugins

Dear McNeel-Team - is it still possible to start Rhino3d v6 with different schemes ?
using Rhino Version 6 SR22
(6.22.20028.13281, 28/01/2020)

i tried to set up 2 schemes - one loading Rhinocam 2019, one - the Default without loading Rhinocam following this 2 year old post:
- but it did not work for me:

Also this article seams not to be up to date:
https://wiki.mcneel.com/rhino/schemes

A work-arround is shown here:


but it requires to restart rhino.

thanks for any suggestions.
best - tom

Hi Tom - what does not work? Do both schemes load RhinoCAM or? Is RC disabled or just not loaded, in one scheme?

To unload a loaded plug-in, you’ll always need to restart Rhino, I do not think there is any way around that.

-Pascal

thanks pascal for your fast answer - yes both schemes load the same plug-in setting - if i turn of in one scheme - both schemes do not load it - if i turn it on in one scheme - both load it -
seams like the plug-in enable-State is not saved in the scheme ;- (

Hi Tom - does the plug-in load if you:

  1. Disable the startup template if you have one
  2. Close and reopen Rhino (so it opens using no template)

Is the plug-in loaded?

-Pascal

got some reply from rhinocam:
there are 2 shortcuts in the windows start folder pointing to

Unload when Rhino 6 Starts
“C:\Program Files\Rhino 6\Plug-ins\RhinoCAM 2019 for R6\RhinoCAMInstallerForRhino6.0x64.exe” /u

and

Load when Rhino 6 Starts
“C:\Program Files\Rhino 6\Plug-ins\RhinoCAM 2019 for R6\RhinoCAMInstallerForRhino6.0x64.exe” /i

but this messes up the plug-in installation…

ok i will stay with PlugInManager and checking / unchecking the enable Checkbox…

otherwise the plug-in will load, regardles of the startup-Template

Hi Tom,

some plugins I need very seldom and so I don’t want to load them at every start. Also I hope to avoid unwanted effects.

My current solution is that I created Rhino buttons to load the plugins. For example:

-_Options _Plugins _Load _FileName “C:\Program Files\Enscape\Bin64\Enscape.Rhino6.Plugin.dll” _Enter _Enter

Maybe you could ask you - why choosing a scheme before starting Rhino if you could select the “scheme” within Rhino per Rhino buttons?

-Micha

Here are a couple of scripts I use (I have a custom button LMB/RMB):

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Script written by Mitch Heynick 02.02.15"""
import rhinoscriptsyntax as rs
def DisableRhinoCAM():
    if rs.LocaleID() ==1036:
        msg = "RhinoCAM est maintenant  désactivé.\n"
        msg+="Vous devez redémarrer Rhino pour que cela prenne effet."
    else:
        msg = "RhinoCAM is now disabled.\n"
        msg+="You must restart Rhino for this to take effect."
    rs.EnablePlugIn("299f02bc35384343aca5d66aaaeb789b", False)
    rs.MessageBox(msg, 64, "RhinoCAM Loader")
DisableRhinoCAM()
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Script written by Mitch Heynick 02.02.15"""
import rhinoscriptsyntax as rs
def EnableRhinoCAM():
    if rs.LocaleID() ==1036:
        msg = "RhinoCAM est maintenant activé.\n"
        msg+="Vous devez redémarrer Rhino pour que cela prenne effet."
    else:
        msg = "RhinoCAM is now enabled.\n"
        msg+="You must restart Rhino for this to take effect."
    rs.EnablePlugIn("299f02bc35384343aca5d66aaaeb789b", True)
    rs.MessageBox(msg, 64, "RhinoCAM Loader")
EnableRhinoCAM()

And no, it’s not possible to do via Schemes, enabling/disabling plug-ins is global for all Rhino instances.

They are localized for French, but you can also localize them for German… :stuck_out_tongue_winking_eye:

did anybody play with setting Registry-Keys - as this could be done without or before starting rhino ?

[HKEY_CURRENT_USER\Software\McNeel\Rhinoceros\6.0\Global Options\Plug-ins\299f02bc-3538-4343-aca5-d66aaaeb789b]
"LoadProtection"="2"

loadprotection = 1 -> plug in will load
loadprotection = 2 -> plug in will not load

but did not find any documentation about it ;-/

ok i come up with the following:
setting the registry seams to work very well - and without starting rhino:

i use a small console - app c# - no rhinocommon:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;

namespace SetRegistryKey
{
    // small Programm to set a rhino-registry-key to load / not load a pluginin
    // pass plugin-Guid and 
    class Program
    {
        // args[0] -> plugin Guid
        // args[1] -> "1" -> load plugin "2" do not load plugin
        static void Main(string[] args)
        {
            if (args.Length == 2 &&
               (Guid.TryParse(args[0], out _)) &&
               (int.TryParse(args[1],out _)))
            {
                string keyName = @"HKEY_CURRENT_USER\Software\McNeel\Rhinoceros\6.0\Global Options\Plug-ins\" + args[0]; // + "\\" + "LoadProtection";
                Registry.SetValue(keyName, "LoadProtection", args[1]);
            } else
            {
                Console.WriteLine("Bad Arguments");
                Console.WriteLine("Press any key to quit");
                Console.ReadKey();
            }
        }
    }
}

i call this app via a shortcut, and the shortcut is including the parameters:
plugin-Guid and 1or2
for example for Rhinocam 2019:

Shortcut Target to disable is:
"C:\Program Files\Rhino 6\Plug-ins\SetRegistryKey.exe" 299f02bc-3538-4343-aca5-d66aaaeb789b 2
Shortcut Target to enable is:
"C:\Program Files\Rhino 6\Plug-ins\SetRegistryKey.exe" 299f02bc-3538-4343-aca5-d66aaaeb789b 1

for me this works very well. best from zurich - tom

thanks for the scripts…