Rhino C# Extrude a surface to a solid

My guess would be that it’s similar to this: