GetCurveObject & Object Groups

Using Python script. When using:

rs.GetCurveObject()

How do I know if the user selected an individual curve or a curve that is within a group? If they selected a curve within a group, how do I get the GUIDs of all the objects in that group?

crawl through like so:

import rhinoscriptsyntax as rs
from Rhino.RhinoDoc import ActiveDoc as rdoc

crv_id = rs.GetCurveObject('select curve')[0]
group_indices = rdoc.Objects.FindId(crv_id).GetGroupList()

if len(group_indices)>0:
    for i in group_indices:
        for m in rdoc.Groups.GroupMembers(i):
            print(m.Id)
else:
    print('no groups')