Moving Beyond Anvil (General Discussion)

I am starting to work a C# project (sadly no Python or Anvil in my near future).
I’m a little rusty in C#, so I asked ChatGPT for help.
I asked this and I got a wonderful answer (too long to put here, you can try it yourself).

convert this c# code from functions to linq:
var ids = new ObjectId[objects.Count];
    for (var i = 0; i < objects.Count; i++)
        ids.SetValue(objects[i].ObjectId, i);

It looks very good (I haven’t tested it yet), but I’m definitely going to try it again before googling for this kind of memory refreshers or similar little tasks.

Now let’s start debugging it!

EDIT (while debugging)
Well… I really thought it looked good :frowning:

EDIT 2
Ok, ok, it was actually pretty good. Wasn’t perfect, but the little change required to make it work was very simple to spot.
And it did help me (re)learn something.

4 Likes