C# plugin for Rhino6 to export selected geometry to OBJ file

I’m writing a C++ plugin (for Rhino 6) to export only selected geometry to an OBJ file. (And then subsequently upload it to our clout for further processing & storage). I have a small c# plugin building and running. Just need some pointers on how to export selected objects to OBJ format.

Thanks for any hints that get me going in the right direction!

  • Ian

Hi @ian4,

I’m not sure if you are using C#, C++, or both. Can you please clarify?

If C++, then other than writing your own .obj file (there are lots of code samples on Google), you’ll need to script the Export command, as the Rhino C/C++ SDK does not expose an obj file writer. A few links go get you started:

Running Rhino Commands from Plugins

3ds file writing sample

Hope this helps.

– Dale

I’m using C#, not C++. Scripting the export command seems like it’s worth a shot, I’ll see if that works.

We also have Obj file writing classes in RhinoCommon at

https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_FileIO_FileObj.htm