I may be wrong here but as far as I know you need the renderlayer you wish to modify to be the currently active renderlayer.
Regards, Fredrik -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWPPRasiCignPwrzPdeLD7mESn_jq%2BVM-crQQ%2B5Uj7%3D2kA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.