Use custom environment for reflections

Hi,

Do you know if there is an option to activate the “Use sustom environtment for reflections” option using Rhinocommon?

I can set the environment as follows:

RhinoDoc.ActiveDoc.CurrentEnvironment.ForReflectionAndRefraction = myEnvironment;

but the checkbox is not activated and therefore the environment is not applied.

Thank you very much

Hi @Harper, i couldn’t find anything in the SDK but scripting the command seems to work. Below is in Python but it should be similar using C#:

import Rhino

s = "_-DocumentProperties _Render _Background _UseCustomReflectiveEnvironment _Yes _EnterEnd"
Rhino.RhinoApp.RunScript(s, False)

_
c.

In RhinoCommon use ICurrentEnvironment.ForReflectionAndRefraction Property. ICurrentEnvironment you access through RhinoDoc.CurrentEnvironment Property.

Thank you for your replies,

Nathan I appreciate it but the ICurrentEnvironment.ForReflectionAndRefraction property (accessed through RhinoDoc.ActiveDoc) only sets the environment but does not check the box, “use custom environments for reflections” so the environment is not applied.

Anyway it seems that by setting it through scripting as clement says it is activated, so the workaround is already working for me.

Thanks and greetings