Rigid Body Python Setup

Hi,

how do I set up an object for rigid body simulations without using the “bpy.ops.group.objects_add_active()” method?
I’m generating a lot of bricks with different settings and selecting them and using the bpy-method really slows down the script significantly.

I hope someone can help me, thanks,

Clemens

like this?

for ob in bpy.context.selected_editable_objects:
    bpy.data.groups['RigidBodyWorld'].objects.link(ob)

Thanks a lot CoDEmanX. I was really stuck there.