Grouping Blender Objects

Hi guys,
I want to know if we can group blender objects via Blender Python API. I have create a set of NURBS patches and I want to group them. If its possible, it’d be great if you can give me an example, or link…

Thanx

With the latest CVS Blender…


from Blender import Scene, Group
scn = Scene.GetCurrent()
grp = Group.New('MySurfGroup')
for ob in scn.objects:
    if ob.type == 'Surf':
        grp.objects.link(ob)


thanx…will give it a try now.

I have problem with grouping objects with python… After I group them and reload the file the group disapears.

Yep, there was a group user count error (blenders lib data has different rules for different datatypes)

I fixed this a while ago in the CVS.