Skip to content

hrntsm/MEF-for-Grasshopper-Plugin

Repository files navigation

MEF for Grasshopper Plugin

What is MEF?

About this repository

I saw New way to load a C# .net plugin on Rhinoceros Forums and it looked interesting, so I'm trying it out.

The basic idea is as in the following article, but the article is for Rhino commands, so I'm making one for Grasshopper

https://www.codeproject.com/Articles/1091178/Managed-Extensibility-Framework-MEF-Plugin-for-Rhi

Rhino command version here

LICENSE

The original article was published under The Code Project Open License (CPOL) 1.02.

This repository is under MIT License

How to use

For more detail, please see the original article.

  1. Build the solution
  2. Load GHPluginLoader.gha in GHPluginLoader/bin/ so that the "LoadPlugin" component can be used.
  3. When you execute the LoadPlugin component, it needs dll path, so refer to the dll file where the component you want to execute is actually written.
    • As an example, the csproj to create a Line is GHPluginMakeLine, so refer to the dll file in its bin
  4. The component described in MakeLine.cs will be executed.
  5. Normally, Rhino needs to be restarted when the component code is rewritten, but in this case, MEF is used to load dll each time the LoadPlugin component is executed, so there is no need to restart.
  6. ;DDDDDDDDDDDDDDD

DEMO

demo

About

Load a Grasshopper plugin through MEF

Topics

Resources

License

Stars

Watchers

Forks

Languages