public void Terminate() { Application.Idle -= OnIdle; GhDrawingContext.Terminate(); GrasshopperDataExtension.Terminate(); Rhinoceros.Shutdown(); }
private void OnIdle(object sender, EventArgs e) { var activeDoc = Application.DocumentManager.MdiActiveDocument; if (activeDoc != null) { GrasshopperDataExtension.Update(activeDoc); } GhDrawingContext.Process(); }
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(); }
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; }