Exception iterating RhinoApp.ToolbarFiles in latest WIP

Hi,
the following code snippet throws a IndexOutOfRangeException after first iteration

foreach (var tf in RhinoApp.ToolbarFiles) {
     if (tf.Name == "default") {
          defToolbarFile = tf;
     }
}

Any way to work around this? Should I just wait for a fix?

Thanks

Hi @m.camillo,

Thanks, I’ve logged the issue.

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

– Dale

RH-71511 is fixed in the latest WIP

Hi,
so I managed to test the solution and the iteration doesn’t throws anything now. Anyway, I found another issue: I tried to open a .rui file created with Rhino 7 with

var tollFile = RhinoApp.ToolbarFiles.Open(pathToRui)

but this returns null. I manually linked the file using Rhino 8 settings and it works as expected.
Is there any compatibility issue?

Thanks

Bug is still encountered in latest WIP version 8.0.22347.14305, 2022-12-13

@JohnM - can you help with this?

Hi,
ToolbarFiles.Open() still returns null with a valid RUI file, I’m on WIP version 8.0.23010.12305

Hi @m.camillo,

Yes this is true and known. This isn’t likely to change until we get closer to shipping Rhino 8.

– Dale

1 Like

Hello, I have the same issue trying to load a *.rui file.
The file is not loaded and ToolbarFiles.Open() returns null.

Any update?

1 Like

Hi @p.stragliotto,

We’re getting there.

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

– Dale

1 Like

Hello again,

the opening of `.rui files now works as expected, but another (minor) issue has risen.

Every time I open the Tools >> Options… dialog and go to the Toolbars section, our toolbar is reloaded as a duplicate (in the screen below you can see what happened after opening the options dialog 16 times).

Fun fact, only the first item seems to be “active” (that is, toggling its checkbox hides/shows the toolbar), all other items just seem to be dead/inactive.

Although the toolbar works as expected, having all these duplicates entries can be disorienting for users.
Any idea of what is happening under the hood, @dale ?
Thanks :slight_smile:

1 Like