Run a command from the C#

Hello to all I read this thread:
And the solution proposed by @matt_newberg works perfect if I run the script from Rhinoscript editor.
I need to run it from a C# code.
I have been trying many options, but obviolsy none of them had work.

                string vr = "V-Ray for Rhino";
                string code = string.Format("Dim VRay: Set VRay = Rhino.GetPluginObject({0}) : VRay.SetBatchRenderOn True", vr);
                string script = string.Format("!-_RunScript -_code");  //
                Rhino.RhinoApp.RunScript(script, true);

any help will be very appreciated.
kind regards

Hi @cidelab,

See the following:

– Dale

1 Like

Thank you @dale,
I will try it,