IGES exporter doesn't follow unit settings from headless doc

It seems the exporter doesn’t follow unit system settings from headless document. Unit of the exported IGES file is inch instead of millimeter with the following code.

  private void RunScript(string file, Surface srf, bool export, ref object result)
  {
    if(!export) return;
    var doc = RhinoDoc.CreateHeadless(null);

    doc.ModelUnitSystem = UnitSystem.Millimeters;
    doc.Objects.Add(srf);

    result = doc.Export(file);

    doc.Dispose();
  }

test_iges_export.gh (2.3 KB)

(pay attention to unit system indicator in the bottom-left corner)

@pascal I think Rhino Developer is probably better because it’s an issue in RhinoCommon. I just use Grasshopper as a tool to call SDK functions. It’s not necessarily related to GH.

Yep, I see that.

https://mcneel.myjetbrains.com/youtrack/issue/RH-66189

– Dale

Hi everyone, I’m currently experiencing the same issue, but from the end user perspective.I do not know if this is still the right place to post this comment, yet I’d appreciate any help.

I am using the command pcExportIges from Pancake addon, with Rhino 7 (SR38) and Pancake v.2.8.1.0.
Everything works fine, yet when I open the .iges file - generated with pcExportIges- I realize that inch is set as length unit for the file, although my default unit option for Rhino is millimeters.

let me check

but it might be an issue from Rhino 7 which is no longer being maintained

1 Like