AutomationSample: GetPlugInObject(pluginId, pluginId)

Hi all, i want to develop an application that runs automatically rhino with a plugin, so i start looking this code (Automation Sample)

but i can’t understant the 58th code line:

plugin = rhino.GetPlugInObject(pluginId, pluginId);

in the documentation i can’t find that function, so why that works? Also i tried to use the listed function in the documentation, but them don’t work.


Hi Alessio,

The GetPlugInObject method on the Rhino application object returns a COM object from a plug-in. The first parameter to the method is the UUID of the plug-in that you want the object from. The second parameter is the UUID of the object or type of object you want returned. In the example you reference, the plug-in only has a single COM object. Thus, the second parameter is ignored.

Does this help?

~ Dale

1 Like

Thanks for your reply dale, yes it is helpful, at least now i know why there are two parameters.

But i still have a doubt: where is decladerd that method?

Or it’s a feature of all COM methods that require an additional parameter that specify the type?

Thanks again for your time

I don’t believe it is documented anywhere. But here is some good information on automating Rhino.

There isn’t much you can do with either the Rhino application or interface objects.

If this were implemented in .NET, this is what the class declaration might look like:

class RhinoApplication
  // Shows or hides Rhino
  public int Visible { get; set; }

  // Gets the RhinoScript COM object (from the RhinoScript plug-in).
  public dynamic GetScriptObject();

  // Get a COM object from some plug-in.
  public dynamic GetPlugInObject(string plugin_uuid, string interface_uuid);

  // Runs a script or command macro (i.e. RhinoApp.RunScript).
  public int RunScript(string script, int mode);

Does this help?

1 Like

Thanks dale for your help