Load .NET plug-in from C++ command?

Last week I was trying to load a .NET plug-in from a C++ command using the code below. The GUID is from the .NET plug-in. The loading does not succeed, however, and I get an error message that the GUID is not known. (but it is, I checked).

Is there a special way to load a .NET plug-in from C++ code?

ON_UUID id = ON_UuidFromString("94c83730-f7fa-4994-ad04-45029756a82e");

CRhinoPlugInManager pm;
CRhinoPlugInRecord* rec = pm.GetPlugIn(id);
if (!rec || !rec->IsLoaded())
    pm.LoadPlugIn(id);


See if this works any better.

ON_UUID id = ON_UuidFromString("94c83730-f7fa-4994-ad04-45029756a82e");

CRhinoPlugInManager& pm = RhinoApp().PlugInManager();
CRhinoPlugInRecord* rec = pm.GetPlugIn(id);
if (rec && !rec->IsLoaded())
  pm.LoadPlugIn(id);
2 Likes

I guess we should try to hide constructors for classes like this from the SDK :smile:

Aha! That makes sense :smiley: