Block plugin from loading?

I use this script to launch Grasshopper from Ansys discovery live

public static void ShowGrasshopperWindow()
            string script = "!_-Grasshopper _W _T ENTER";
            if (_firstRun)
                _firstRun = false;
            Rhino.RhinoApp.RunScript(script, false);

But Ansys force closed when i launched Grasshopper , maybe because of some plugins.
How i can launch Grasshopper without any plugin?
Or how i can block some plugins from loading?

You can also add an empty text file named “ExtensionName.no6” in the Libraries folder. This will prevent the associated extension from being loaded.

1 Like

Thanks but i want this by scripting because Grasshopper opened from Ansys

Thanks, this can be done with GrasshopperIgnorePlugin but works only with gha files and the problem i think is with python components: ghpy extension

OK, maybe you could move (by script) the ghpy files in another folder before launching Grasshopper ?

I can’t do this everytime i use Ansys

As long as you have another script that is called when you launch Grasshopper from Rhino to put them back in place, it could still be possible (I’ve made such horrible things in the past but once it works, you forget about it).

However have you tried manually removing every plugin and launch GH from Ansys, to see at least if the problem comes from that ?

Let me understand - you want Grasshopper to load with certain set of plugins when starting “normally” and with a different set of plugins when started using your script?

@magicteddy is correct in that you probably can’t achieve this without manipulating the folders the plugins are loaded from.

You can save plugins you want to load only optionally to a different folder than the standard %APPDATA%\Roaming\Grasshopper\Libraries and then add the path to the new folder using GrasshopperDeveloperSettings. This will enable GH to find .GHAs at load time even when stored at different than “standard” location.

Next step is manipulating GrasshopperDeveloperSettings programatically before you start loading Grasshopper, to avoid loading from paths that contain the problematic plugin(s). You can do this by editing the <item name="Assemblies:Folders"> xxx </item> entry in %APPDATA%\Roaming\Grasshopper\grasshopper_kernel.xml.

This is very interesting. A while ago I’ve tried accessing the developper settings directly from Grasshopper.Folders.AssemblyFolders, the problem being that as soon as this line was called, GH started a blank document without loading ANY plugins. So I ended up moving the file as a workaround.

When i opened Grasshopper from Ansys long time ago it appears that the problem with python components.
Today it closed immediately, i will try use load plugin one by one

I will try that thanks. and Plugin loading don’t disable plugins from loading, did you try it?