When I select multiple files using the code below, not all files are being entered in the FileNames array correctly. This is most likely due to a fixed length array of some sorts (?). This is especially the case with deeply nested folders. I run into this problem when the combined number of characters of the files exceeds about 750.
Note: this is different from https://mcneel.myjetbrains.com/youtrack/issue/RH-37371 but may be related to how that was fixed by @JohnM
protected Result RunCommand(RhinoDoc doc, RunMode mode)
{
OpenFileDialog fd = new OpenFileDialog
{
Title = "Select files to apply grids to",
DefaultExt = "3dm",
MultiSelect = true,
Filter = "Rhino 3D Models (.3dm)|*.3dm"
};
if (fd.ShowOpenDialog())
{
foreach (var f in fd.FileNames)
{
RhinoApp.WriteLine(f);
}
}
return Result.Success;
}