I’m writing a program to consume DGN files in a headless Rhino environment (using Rhino.Inside), and I’ve run into a few limitations.
Specifically, I want to open a DGN file in a headless document while preserving the units of the DGN file, just like opening a file via Rhino’s UI Open command.
Here’s what I’ve discovered so far:
RhinoDoc.CreateHeadless(null) + doc.Import(dgnFile) does not preserve the DGN units. Geometry gets scaled to mm (default template units of the headless doc).
RhinoDoc.OpenHeadless(path) works exactly as I want for 3dm files, but it can only accept 3dm files .
FileDgn.Read(path, doc, options) essentially just calls doc.Import, and the FileDgnReadOptions do not expose an “Open” mode or a “ScaleGeometry” option like other file read options do.
Are there any work arounds or methods I’ve missed?
I’m looking into this now. Can you point me to the FileReadOptions you speak of when you say, “expose an “Open” mode or a “ScaleGeometry” option like other file read options do”?
I think I must have initially dismissed this being a potential option, because the other OpenHeadless overload throws if you call it with anything other than a 3dm extension.