import c4d
def main():
objs = doc.GetActiveObjects(0)
objs[0].DelBit(c4d.BIT_ACTIVE)
objs[1].SetBit(c4d.BIT_ACTIVE)
c4d.CallCommand(17891, 17891) # Polygon Groups to Objects
objlist = objs[1].GetChildren()
for obj in objlist:
obj.SetBit(c4d.BIT_ACTIVE)
c4d.CallCommand(1011982) # Center Axis to
pos = obj.GetMg().off
ref = objs[0].GetClone()
ref[c4d.ID_BASEOBJECT_REL_POSITION] = pos
doc.InsertObject(ref)
c4d.EventAdd()
if name=='main':
main()