Rhino.PlugIn to execute .rhp file

I’d like to call MeshFromPoints from Grasshopper. MeshFromPoints only exists as a .rhp file, and not exposed in the C# API. So, I think this is done via the PlugIn system, according to this post.

(Inside a Grasshopper C# component)

using Rhino.PlugIns;
...
var path = "C:\\Program Files\\Rhino 8\\Plug-ins\\MeshFromPoints.rhp";
PlugIn.LoadPlugIn(path, out var plugInId);

// plugInId is 00000000-0000-0000-0000-000000000000

var myPlugIn = PlugIn.Find(plugInId); // this doesn't work, the result is null

The plugInId looks wrong, but, there is no error. If I misspell the filename I do get an error. So maybe this ID is correct?

I feel like I’m approaching this incorrectly. I’ve read the PlugIn docs. I found this post which makes me think I need to use PlugIn as a superclass, but even still, I’m not sure what to do if I do this,

public class MyPlugIn : PlugIn {
    protected override void CreateCommands() {
        base.CreateCommands();
    }
}

any pointers would be greatly appreciated! :slight_smile:

Hi @Maya8,

What does this mean?

The MeshFromPoints plug-in contains a single MeshFromPoints command - it has no callable API.

Perhaps I don’t understand what you’re trying to do?

– Dale

Hi @dale
Broadly, I’d like to automate the process of mesh-ifying a pointcloud. I was hoping to have a Grasshopper C# component which runs MeshFromPoints. Input-PointCloud, Output-Mesh.

The MeshFromPoints plug-in contains a single MeshFromPoints command - it has no callable API.

Ah, I see. I guess what I’m trying to do impossible? Is there any other way around it?

Hi @Maya8,

As far as creating meshes from point clouds, you might search this forum, and the Internet for that matter, to see what others are doing.

A quick Google search give me this:

I’m sure there are other techniques.

Regarding the MeshFromPoints command, I don’t know if there is a clever way of automating this using Grasshopper - a question to ask in the Grasshopper category.

– Dale

Thanks @dale !
My colleagues actually looked at a lot of other options and everyone prefers Rhino’s MeshFromPoints. It’s very good! :slight_smile: We would settle on a not-fully automated workflow if it means using MeshFromPoints.

Hi @Maya8,

I’ve logged a wish to expose MeshFromPoints to RhinoCommon.

https://mcneel.myjetbrains.com/youtrack/issue/RH-82435

– Dale

that’s fantastic, thanks for your help @dale !