RhinoCommon: Set Dark Theme

Hi,
Is there a way to set the dark theme by code?


Thanks,

Hi @rafadelmolino,

The Options command can be scripted.

_-Options _Appearance _Colors _Dark _EnterEnd

– Dale

1 Like

Hi Rafael,

Below a piece of code I use to do some settings. I’ve added a viewport color setting as example for you.

try
            {
                Rhino.ApplicationSettings.AppearanceSettings.ShowSideBar = false;
                Rhino.ApplicationSettings.ModelAidSettings.NudgeMode = 2;
                Rhino.ApplicationSettings.ModelAidSettings.NudgeKeyStep = 1;
                Rhino.ApplicationSettings.ModelAidSettings.CtrlNudgeKeyStep = 3;
                Rhino.ApplicationSettings.ModelAidSettings.ShiftNudgeKeyStep = 5;
                Rhino.ApplicationSettings.AppearanceSettings.ShowCrosshairs = true;
                Rhino.ApplicationSettings.AppearanceSettings.ViewportBackgroundColor = System.Drawing.Color.AliceBlue;

                //format folderpath for source file
                string folderPath = "PluginData\\PLTTemplate\\";
                string templatePLTPlugin = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), folderPath, "PLT Template V01EN.3dm");
                //Check if grasshopper file exists
                if (File.Exists(templatePLTPlugin) == false)
                {
                    return Result.Failure;
                }
                //set template if isnt equal to the plttemplate
                string currentTemplate = Rhino.ApplicationSettings.FileSettings.TemplateFile;
                {
                    if (!currentTemplate.Equals(templatePLTPlugin))
                    {
                        Rhino.ApplicationSettings.FileSettings.TemplateFile = templatePLTPlugin;
                    }
                }

                return Result.Success;
            }
1 Like