Пример #1
0
 public void Terminate()
 {
     Application.Idle -= OnIdle;
     GhDrawingContext.Terminate();
     GrasshopperDataExtension.Terminate();
     Rhinoceros.Shutdown();
 }
Пример #2
0
        private void OnIdle(object sender, EventArgs e)
        {
            var activeDoc = Application.DocumentManager.MdiActiveDocument;

            if (activeDoc != null)
            {
                GrasshopperDataExtension.Update(activeDoc);
            }
            GhDrawingContext.Process();
        }
Пример #3
0
 public static void StartGrasshopper()
 {
     if (Rhinoceros.Script.IsEditorVisible())
     {
         Rhinoceros.Script.HideEditor();
     }
     else
     {
         if (System.Convert.ToInt16(Application.GetSystemVariable("DWGTITLED")) == 0)
         {
             _WF.MessageBox.Show("Bricscad drawing must be saved before using Grasshopper");
             return;
         }
         Rhinoceros.Script.ShowEditor();
         GhDrawingContext.RelinkToDoc(Application.DocumentManager.MdiActiveDocument);
     }
     UI.GhUI.CustomizeUI();
 }
Пример #4
0
        public void Initialize()
        {
            var editor = Application.DocumentManager.MdiActiveDocument.Editor;

            if (!Rhinoceros.Startup() || !Rhinoceros.LoadGrasshopperComponents())
            {
                editor.WriteMessage("\nFailed to start Rhino WIP");
                return;
            }
            var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            editor.WriteMessage($"\nGrasshopper-BricsCAD Connection {version}");

            GrasshopperDataExtension = new GhDataExtension();
            GrasshopperDataExtension.Initialize();
            GhDrawingContext.Initialize();
            Application.Idle += OnIdle;
        }