When I right click on a segment and click "Idealize", it works as expected.
But when I execute this Lua code:
I used print(selection.GetCount()) to confirm that segment 5 was selected. I tried other segments as well, but to no avail.
No errors appear in the console.
I checked the documentation, but couldn't find any obvious issues.