I can’t repeat this testing here in the debugger. This is the code I’m using based off of yours.
[CommandStyle(Rhino.Commands.Style.Hidden)]
public class TestHeadlessFileExport : Rhino.Commands.Command
{
public TestHeadlessFileExport()
{
TheCommand = this;
}
/// <summary>The one and only TestHeadlessFileExport object instance</summary>
public static TestHeadlessFileExport TheCommand { get; private set; }
///<returns>The command name as it appears on the Rhino command line.</returns>
public override string EnglishName
{
get { return "TestHeadlessFileExport"; }
}
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
GetObject go = new GetObject();
go.GeometryFilter = ObjectType.Mesh;
if (GetResult.Object != go.Get())
return Result.Cancel;
Mesh mesh = go.Object(0).Mesh();
if (null == mesh)
return Result.Failure;
RhinoDoc export = RhinoDoc.CreateHeadless(null);
export.Objects.Add(mesh);
export.Export(Path.Combine("C:\\Users\\tim\\Desktop\\junk.raw"));
export.Dispose();
return Result.Success;
}
}
This iteration I tried exporting to raw but stl worked fine too, just changing the extension. Is it limited to a specific model? If yes, can you share that? You can upload it here if it’s not for public consumption.