Пример #1
0
        /// <summary>
        /// 启动 Python
        /// </summary>
        /// <param name="buttonEvent"></param>
        /// <returns></returns>
        public static MenuBarManager.CallbackStatus StartIronPython(MenuButtonEvent buttonEvent)
        {
            Guid PluginId = new Guid("814d908a-e25c-493d-97e9-ee3861957f49");

            if (!PlugIn.LoadPlugIn(PluginId, true, true))
            {
                throw new Exception("Failed to startup IronPyhton");
            }

            Rhinoceros.RunScript("_EditPythonScript", activate: true);

            return(MenuBarManager.CallbackStatus.Continue);
        }
Пример #2
0
        public static MenuBarManager.CallbackStatus StartGrasshopper(MenuButtonEvent buttonEvent)
        {
            Logger.Info("Starting Grasshopper");

            Thread.CurrentThread.CurrentCulture   = CultureInfo.InvariantCulture;
            Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;

            Rhinoceros.RunScript("_Grasshopper", activate: true);

            //Instances.DocumentEditor?.GetHashCode().ToString().ConsoleWriteLine();

            //Guest.ShowEditor();

            Rhinoceros.MainWindow.BringToFront();

            Logger.Info("Start Grasshopper Succesfully.");

            return(MenuBarManager.CallbackStatus.Continue);
        }