WriteFile works on Rhino5 but does not work on Rhino6 to export vrml files


This code works fine in Rhino 5 for exporting an wrml file but in Rhino 6 it is exported a 3dm file.
I can´t find a method to export objects to a wrml file…


        DialogResult rc;
        string tex_name, tex_name_dst, dst_path, filename;
        System.Windows.Forms.SaveFileDialog gf;
        FileWriteOptions options;

            gf = new System.Windows.Forms.SaveFileDialog( );
            gf.Title = "VRML Export"
            gf.AddExtension = true;
            gf.CheckPathExists = true;
            gf.DefaultExt = ".wrl";

            rc = gf.ShowDialog( RhinoApp.MainApplicationWindow );
            if ( rc != DialogResult.OK ) return false;

            filename = gf.FileName.Trim( );
            if ( string.IsNullOrEmpty( filename ) ) return false;

            options = new FileWriteOptions( );
            options.WriteSelectedObjectsOnly = true;

            RhinoDoc.ActiveDoc.WriteFile( filename, options );

Hi @Eliseo,

Honestly, the best way to write a file in a format other than .3dm is to script the Save, SaveAs, or Export command. Here is an example that write a .dxf file.


– Dale

1 Like