Rhinoscript: Why am I getting an ‘object is not subscriptable’ error when going through the groups via the index. Can we not iterate through the list of groups? Create a couple groups in your active document and run the following code:
grps = Rhino.RhinoDoc.ActiveDoc.Groups
print 'Number of groups: ' + str(len(grps))
print
y = 0
for x in grps:
print 'Group ' + str(y) + ' Name: ' + x.Name
y += 1
print
for y, x in enumerate(grps):
print 'Group ' + str(y) + ' Name: ' + x.Name
print
for x in range (len(grps)):
print 'Group ' + str(x) + ' Name: ' + grps[x].Name