How can I set the Rendering's Samples value in RhinoCommon?

Hi, guys.
How can I set the picture’s value in RhinoCommon?
Thank you very much!


You could do something like this:

#! python3

import scriptcontext as sc
import Rhino

# read from settings
samples = sc.doc.RenderSettings.UserDictionary.GetInteger('Samples', 1000)
# set new samples count
sc.doc.RenderSettings.UserDictionary.Set('Samples', 50)

I’m not sure how to ensure setting like this triggers Rhino to react to that. @maxsoder do you know how that can be achieved? I don’t see an obvious way to do this without CollapsibleSectionViewModel and INotifyPropertyChanged.

Running the Set on the user dictionary with 'Samples' key works, but you need to toggle the raytraced view for instance.

1 Like

Thanks. It’s prefect.

1 Like