A really common question, of new or less new Grasshopper3d users, is why the 3rd party add-ons they’re trying to install are not appearing on the ribbon layout of the canvas. In the, not at all exaggerated, 99% of the cases, the issue lies in the fact that these files are “blocked” by windows.
You can briefly learn more about why windows block some files, especially downloaded from the web, here.
The common solution to this to prompt the user to right-click on the blocked .gha or .dll file, open the properties tab and click the unblock option on the bottom right corner of the properties window. Something that is efficient, but can take ages, if you don’t know which file is blocked, or have to unblock many files at the same time.
The code below saves all the fuss that could emerge from looking which files are blocked, or even by just clicking three times on a file to unblock it (yes I am kind of lazy..)
It also saves some people (GH forum users) the trouble explaining or troubleshooting the same scenario every single time.
So, by just clicking on the button toggle of this Grasshopper3d definition and executing the script you automatically unblock all the files in your local GH libraries directory. This ensures that when you restart Grasshopper, all the add-ons in this folder will be loaded onto the ribbon tab.
I also added an extra option that will install a special key to your registry, so that an complementary option of unblocking files is going to appear on the dropdown right – click menu. This of course means that you can select multiple files and unblock the simultaneously. Info on how to get rid of this extra option is provided while running the component. As you may have guessed, adding new keys to your registry relies heavily on your admin rights.
Following is a simple illustrated breakdown of the process.
If your IT department has block your admin privileges don’t expect this to work. However it has been tested successfully on personal pc’s, on Windows 7, 8.1 and 10. Special thanks to Angel, Mateusz, Michael, Stamatis and Andrea for beta testing.
I will upload the c# code on my github account. So any takes and tweaks are more than welcome.
The code utilizes extracts from these two discussions
Beware that this code might not be bug free (most probably is full of bugs) and I do not take any responsibility if you destroy your computer.
You can grab the def and an extra GH user object to keep this snippet constantly in your GH toolbox here.