RhinoDoc.ReadFile interrupted with 'import scaling - DimensionNumbers'

Hello,
I am using ReadFile and also defining FileReadOptions:

image

image

However, the import is still interrupted saying “import scaling - DimensionNumbers”

image

I am using the ReadFile command to import a .3dm rhino file.

Related post:

1 Like

Hi @atharvaranade4,

Can you provide me simple code sample, that I can run here, that repeats this?

Thanks,

– Dale

using Rhino;
using Rhino.Commands;
using System;
namespace ImportCodeSnippet
{
    public class ImportCodeSnippetCommand : Command
    {
        public ImportCodeSnippetCommand()
        {
            Instance = this;
        }
        public static ImportCodeSnippetCommand Instance { get; private set; }
        public override string EnglishName => "ImportCodeSnippetCommand";
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            RhinoApp.WriteLine("The {0} command is under construction.", EnglishName);
            Rhino.FileIO.FileReadOptions options = new Rhino.FileIO.FileReadOptions
            {
                BatchMode = true,
                ImportMode = true,
                ScaleGeometry = true,
                UseScaleGeometry = true,
            };
            string filepath = Environment.ExpandEnvironmentVariables(@"%AppData%\SnippetSamplePlugin\1_Production.3dm");
            var result = Rhino.RhinoDoc.ReadFile(filepath, options);
            return result ? Result.Success : Result.Failure;
        }
    }
}

Note: We are using ‘%AppData%’ for the sake of this demo code snippet.

Please find attached rhino file:
1_Production.3dm (168.9 KB)

Hi @atharvaranade4,

Thanks, I’ve logged the issue.

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

– Dale

1 Like