Using WeaverBird from C# Rhp plug in [SOLVED]


#1

Hi,

I am trying to make a new plugIn for Rhino in C#. Tests are working great so far.

In GH I was using WeaverBird to create a mesh from lines and I am experiencing some issues to make this happen in the plugIn.

  • I have imported WeaverBird Rhp into my C# project.
  • I have created an instance of WbMeshFromLinesCommand with no issues.

The problem comes when I am trying to run the command. It is asking for IRhinoCommandContext and I have no clue where I can get the context, so I can pass it as argument. If it is possible I would like to avoid RhinoApp.RunScript.

Any suggestion? Thanks


(Luis Fraguada) #2

This has been implemented into RhinoCommon for RhinoWIP http://developer.rhino3d.com/api/RhinoCommonWin/html/M_Rhino_Geometry_Mesh_CreateFromLines.htm


#3

is it the same algorithm used by weaverbird?


(Luis Fraguada) #4

I believe they are related. @piac might be able to confirm.


#5

ok, thanks Luis. by the way,mesh from lines was already present in Rhino 5…


(Giulio Piacentino) #6

Yes. And Mesh.CreateFromLines() is available in RhinoCommon.


(Luis Fraguada) #8

I think the main difference in the wip is being able to get ngons out.

mesh from lines was already present in Rhino 5…

I don’t recall it being available in RhinoCommon for Rhino 5, but I might be mistaken.
Yes, it is achievable with Weaverbird in rhino 5, but if you are writing a C# plugin, why script the command when you have a method?


#9

you are right Luis, its not present in Rhino 5. I guess that I was in Rhino Wip when I used it… my memory is getting worse!

By the way, the “Aitor” who wrote the first message was not me… but a friend of mine! (basque country is a small place)


#10

Rhino Wip’s RhinoCommon library has that method implemented. But. cannot build plug-in for Rhino 5 with that library.
Anyway, it is good to know there is a solution for this in future versions. Right now I can keep going with a workaround.
Thanks.