Dunno, AddGroup() is supposed to return the group name. Both of these work here:
import rhinoscriptsyntax as rs
group = rs.AddGroup("MyGroup")
group = Rhino.AddGroup("MyGroup")
Both vb and python rhinoscriptsyntax return the group name. Note if the name already exists, it also adds a number after the name to make the group name unique, so the added group name might not be the same as strName… Just a heads-up.
Thanks for continuing this. Upon even further testing it appears as though the groupname isn’t returned (None returned) if the assigned group name already exists…well that seems to be the issue. I ran the full command twice, first time returned the groupname properly, second time (on a different object that had the same name to be assigned to the group) it returned None and crashed out of the command. This was repeatable on a second pair of objects with the same groupname to be assigned to each, first worked, second didn’t.
The simplest solution is probably to explicitly make the groupname unique to avoid this issue. That won’t create any foreseeable issues down the line.