Help Needed: Script for Setting Rhino 3D Render Engines Not Working

I tried to write a script that queries and lists the installed render engines, then sets the selected engine according to the user’s preference. But unfortunately, it doesn’t work. Can anyone help with a solution? Thank you!
select_render_engine_eng.py (1.2 KB)

Instead of trying to set CurrentRenderPlugInId use Utilities.SetDefaultRenderPlugIn Method :

Rhino.Render.Utilities.SetDefaultRenderPlugIn(plugin_id)

If I choose the Bella rendering engine, can I modify Bella’s parameters through this Python script, for example, the “Bella Camera Focus - Mode = Pinhole”?

I have not used Bella, so I don’t know how these settings are exposed to Rhino. You’d have to ask @jdhill. Best to do so in a new topic so that this topic stays on the one issue that is now already answered and solved.

Thank you for your help; it was useful!