How to write script in C# for JoinEdges Command


I’d like write a GH battery to achieve the function like JoinEdges command in rhino,but I can’t find a method can acheive the fuction like JoinEdges command in the RhinoCommon SDK.So I want to know which method in the RhinoCommon SDK can achieve the function like JoinEdges command in rhino and which class the method belong to ?

(Dale Fugier) #2

Hi Jason,

The Rhino SDK does not have a functional equivalent to the JoinEdges command. I’ve added a wish item for this.

Just curious, what kind of tool are you writing that requires this functionality?

– Dale


Hi Dale,

Thank you for your reply.I’m writing the tool for creating sheet metal model,thera are some edges of it can’t be joined.So I can’t use the Join command.

I’d like to know how the JoinEdges command achieve if the Rhino SDK does not have a functional equivalent to it,like use mutiple function?Or if Rhino SDK does have a functional equivalent to the UnjoinEdge ctommad?

– Jason

(Dale Fugier) #4

If you have surfaces that cannot be joined, then joining by edges may not be the best approach to solving your problem. It may actually cause additional problems down stream.

Can you post some geometry that you are having problems joining?

– Dale


For example,the red edges of the sheet metal model in the picture which should be joined,and the white edges shouldn’t.If use Join command,the white would bo joined,then the white edges should be use UnJoinEdge Command to unjoin.Or use the JoinEdge Command to join the red edges.


(Dale Fugier) #6

Jason - can you post the 3dm file?


The problem you are encountering is due to the fact that you are modeling sheet metal with no thickness. If you modeled it as it is in the real world with thickness then you wouldn’t have edges that want to join where they should not.


Example.3dm (45.8 KB)
There are tow models in this file,they looks like as same as,but the black one is which I want.The difference between them you can look for the edge type of them in their attributes.

(Dale Fugier) #9

Hi Jason,

Your information and model have been valuable in helping me understand the problem - thanks,

– Dale


Hi Dale,

According to the discussion between you and Chuck Welsh ,is it the JoinEdges SDK function will be update in the Rhino 6.0?

(Dale Fugier) #11

If you look at the issue:

you can see that it is still open. The current target completion is sometime during the Rhino 6 lifecycle.

I’ve added, though, a new Rhino.Geometry.Brep.UnjoinEdges method to RhinoCommon.

It should be in this week’s WIP release.

– Dale

(Dale Fugier) #12

@JasonZhang, I’ve added two new functions to RhinoCommon to join Brep edges:


It is doubtful these function will make it into this week’s WIP release. But they will, for sure, be in next week’s release.

– Dale


Hi Dale,

Thank you for your help ! I will stay focused on the update log of the WIP release.


(Brian Gillespie) #14

RH-36195 is fixed in the latest WIP