Export Scheme From Headless document

I’m unable to specify the scheme when exporting from and headless document. When I execute the following code :

 Using HeadlessDoc = RhinoDoc.CreateHeadless(Nothing)
            RhinoDoc.ActiveDoc = HeadlessDoc
            Try
                HeadlessDoc.Import("Path\To\Dxf file.dxf")
                RhinoApp.RunScript(HeadlessDoc.RuntimeSerialNumber, "_SelAll", True)
                
                Dim cmd = String.Format("-_Export ""{0}"" _FromIni ""{1}"" _Enter _Enter", ExportPath, DXFSchemeFilePath)
                RhinoApp.RunScript(HeadlessDoc.RuntimeSerialNumber, cmd, True)

            Finally
                RhinoDoc.ActiveDoc = Doc
            End Try
        End Using

The command prompt shows :

Command: -_Export
Save file name ( Version=7 SaveSmall=No GeometryOnly=No SaveTextures=Yes SaveNotes=Yes SavePlugInData=Yes Browse ): “Path\to\Exported File.dxf”

Annotation: 10 written, 0 skipped
Curves: 21 written, 0 skipped
Layers: 11 written, 0 skipped
Textstyles: 2 written, 0 skipped

File successfully saved as Path\to\Exported File.dxf.
Command: _FromIni
Unknown command: _FromIni

Would it be possible to specify export scheme in "Export" command?

We added a bunch of functionality to RhinoCommon in this area for Rhino 8 because it was very difficult to control all of these options from building up strings.

2 Likes