Forcing DXF Export to use INSUNITS

I did a bunch of test exports with Rhino units set to inch and mm, and haven’t seen anything but inch or mm in the insunits field in the dxf’s.

I traced through our code. The part that deals with this is pretty simple.
If the Rhino model units are inches, feet, miles, millimeters, meters or kilometers, INSUNITS gets set to the corresponding value. Otherwise, for any other setting of Rhino units, the default is mm. I tried NoUnits, Custom and LightYears and the default handling worked correctly and wrote 4 for mm.

I’d be happy to chase down any other clues, but at this point, I’m baffled how you can get the wrong type code or value in that field.

Lowell