Export to STEP

Hi,

I’m trying to export to STEP in RhinoCommon. I can only find this class which is only available in Rhino 7 Windows: https://developer.rhino3d.com/wip/api/RhinoCommon/html/T_Rhino_FileIO_FileStp.htm

What’s the recommended way of doing it in Rhino 6, or on Mac?

Thanks!

Best,
Aske

Hi @aske,

Just script the Export command using RhinoApp.RunScript. Here is an example of exporting to DXF. This should give you an idea how to do the same with STEP.

SampleCsExportDXF.cs

– Dale

1 Like

Hey @dale,

Thanks for the reply!

I want to do something like this:

var doc = Rhino.RhinoDoc.Create(null);
var tmpObj = doc.Objects.Add(myGeo);
// TODO: Manipulate tmpObj in the new document, without altering it in the original user document. E.g. reorient it.
// TODO: How do I choose which doc RunScript targets?
var script = $"_-Export \"{filePath}\" _Enter";
RhinoApp.RunScript(script, false);

Maybe this is a convoluted way of thinking about it? Should I instead make a copy of the geo in the current doc, manipulate that, then select it (I find programmatic selection a bit awkward/hard), and then run export selected?

Or is there a third, better option?

Thanks!

Hi @aske,

For Rhino 6, you’ll need to add your objects to the existing document and then script the Export command.

– Dale

1 Like

Alright.
Thanks for the quick responses!