protected override void OnHandleCreated(EventArgs e) { // This is a good spot to start Rhino.Inside as we now have a // handle to the top level parent window for Rhino _rhinoCore = new Rhino.Runtime.InProcess.RhinoCore(new string[] { "-appmode" }, Rhino.Runtime.InProcess.WindowStyle.Hidden, Handle); base.OnHandleCreated(e); }
static void Main(string[] args) { using (var core = new Rhino.Runtime.InProcess.RhinoCore()) { RunHelper(); } }
public void Launch() { _rhinoCore = new Rhino.Runtime.InProcess.RhinoCore(new string[] { "/NOSPLASH" }, Rhino.Runtime.InProcess.WindowStyle.Hidden);//, Rhino.Runtime.InProcess.WindowStyle.NoWindow); if (Rhino.RhinoApp.GetPlugInObject("Grasshopper") is Grasshopper.Plugin.GH_RhinoScriptInterface gh) { Grasshopper.Instances.AutoShowBanner = false; gh.LoadEditor(); var doc = Grasshopper.Instances.DocumentServer.AddDocument(_tempPath, true); doc.NewSolution(true); } }
void IExtensionApplication.Initialize() { // Load Rhino try { string SchemeName = $"Inside-{HostApplicationServices.Current.Product}-{HostApplicationServices.Current.releaseMarketVersion}"; m_rhino_core = new Rhino.Runtime.InProcess.RhinoCore(new[] { $"/scheme={SchemeName}" }); } catch { // ignored } }
void IExtensionApplication.Initialize() { // Load Rhino try { var scheme_name = ProductName().Replace(' ', '-'); m_rhino_core = new Rhino.Runtime.InProcess.RhinoCore(new[] { $"/scheme={scheme_name}" }); } catch { // ignored } }
public void Initialize() { // Load Rhino try { var scheme_name = string.Format("BricsCAD.{0}", Application.Version); m_rhino_core = new Rhino.Runtime.InProcess.RhinoCore(new[] { $"/scheme={scheme_name}" }); } catch { // ignored } var version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); var editor = Application.DocumentManager.MdiActiveDocument.Editor; editor.WriteMessage($"\nRhinoInside {version}"); }
public static void Run() { _rhinoCore = new Rhino.Runtime.InProcess.RhinoCore(new string[] { "-appmode" }, Rhino.Runtime.InProcess.WindowStyle.Hidden); MainForm mf = new MainForm(); mf.Show(); for (int i = 0; i < System.Windows.Application.Current.Windows.Count; i++) { var window = System.Windows.Application.Current.Windows[i]; if (window.IsVisible) { window.Closed += (s, e) => Shutdown(); break; } } System.Windows.Forms.Application.Run(); }
static int Main(string[] args) { var windowStyle = Rhino.Runtime.InProcess.WindowStyle.NoWindow; if (args.Where(arg => string.Equals(arg, "/WindowStyle=Normal", System.StringComparison.OrdinalIgnoreCase)).Any()) { windowStyle = Rhino.Runtime.InProcess.WindowStyle.Normal; } try { using (var core = new Rhino.Runtime.InProcess.RhinoCore(args, windowStyle)) { var sphere = new Rhino.Geometry.Sphere(Rhino.Geometry.Point3d.Origin, 10); var mesh = Rhino.Geometry.Mesh.CreateFromSphere(sphere, 10, 10); System.Console.WriteLine("Created a mesh with {0} vertices and {1} Faces.", mesh.Vertices.Count, mesh.Faces.Count); if (windowStyle != Rhino.Runtime.InProcess.WindowStyle.NoWindow) { return(core.Run()); } else { System.Console.WriteLine("press any key to exit"); System.Console.ReadKey(); return(0); } } } catch (System.Exception ex) { System.Console.Error.WriteLine(ex.Message); } return(-1); }
/// <summary> /// Disposing the context after running all the tests /// </summary> public void Dispose() { // do nothing or... _rhinoCore?.Dispose(); _rhinoCore = null; }
public void StartRhino() { _rhinoCore = new Rhino.Runtime.InProcess.RhinoCore(null, Rhino.Runtime.InProcess.WindowStyle.NoWindow); }
protected override void OnHandleDestroyed(EventArgs e) { _rhinoCore.Dispose(); _rhinoCore = null; base.OnHandleDestroyed(e); }