It is possible to do so. RhinoDoc.CurrentEnvironment gives you access to setting environments. Here an older thread that goes into it.
RhinoDoc.CurrentEnvironment